blob: 75da0aa8ba1e58a945fa89ab55b9000b8668a115 [file] [log] [blame]
[email protected]4447016b2013-02-23 19:07:441// Copyright (c) 2013 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef REMOTING_HOST_WIN_RDP_CLIENT_H_
6#define REMOTING_HOST_WIN_RDP_CLIENT_H_
7
dcheng0765c492016-04-06 22:41:538#include <memory>
[email protected]a4eca0a2013-06-20 22:15:059#include <string>
10
[email protected]4447016b2013-02-23 19:07:4411#include "base/memory/ref_counted.h"
gabbf77513a2017-06-01 14:35:3412#include "base/sequence_checker.h"
[email protected]4447016b2013-02-23 19:07:4413
14namespace base {
15class SingleThreadTaskRunner;
[email protected]8c83a71c2013-12-16 18:02:5816} // namespace base
17
[email protected]4447016b2013-02-23 19:07:4418namespace remoting {
19
joedowb7a9ca32016-12-23 00:15:2520class ScreenResolution;
21
[email protected]4447016b2013-02-23 19:07:4422// Establishes a loopback RDP connection to spawn a new Windows session.
gabbf77513a2017-06-01 14:35:3423class RdpClient {
[email protected]4447016b2013-02-23 19:07:4424 public:
25 class EventHandler {
26 public:
27 virtual ~EventHandler() {}
28
29 // Notifies the event handler that an RDP connection has been established
30 // successfully.
[email protected]a4eca0a2013-06-20 22:15:0531 virtual void OnRdpConnected() = 0;
[email protected]4447016b2013-02-23 19:07:4432
33 // Notifies that the RDP connection has been closed.
34 virtual void OnRdpClosed() = 0;
35 };
36
joedow69094d5f2016-05-03 20:00:0237 RdpClient(scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
38 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
joedowb7a9ca32016-12-23 00:15:2539 const ScreenResolution& resolution,
joedow69094d5f2016-05-03 20:00:0240 const std::string& terminal_id,
41 DWORD port_number,
42 EventHandler* event_handler);
Peter Boströme9178e42021-09-22 18:11:4943
44 RdpClient(const RdpClient&) = delete;
45 RdpClient& operator=(const RdpClient&) = delete;
46
[email protected]4447016b2013-02-23 19:07:4447 virtual ~RdpClient();
48
[email protected]97328ee2013-06-04 06:46:5949 // Sends Secure Attention Sequence to the session.
50 void InjectSas();
51
joedowb7a9ca32016-12-23 00:15:2552 // Change the resolution of the desktop.
53 void ChangeResolution(const ScreenResolution& resolution);
54
[email protected]4447016b2013-02-23 19:07:4455 private:
56 // The actual implementation resides in Core class.
57 class Core;
58 scoped_refptr<Core> core_;
59
gabbf77513a2017-06-01 14:35:3460 SEQUENCE_CHECKER(sequence_checker_);
[email protected]4447016b2013-02-23 19:07:4461};
62
63} // namespace remoting
64
65#endif // REMOTING_HOST_WIN_RDP_CLIENT_H_