[email protected] | 4447016b | 2013-02-23 19:07:44 | [diff] [blame] | 1 | // 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 | |||||
dcheng | 0765c49 | 2016-04-06 22:41:53 | [diff] [blame] | 8 | #include <memory> |
[email protected] | a4eca0a | 2013-06-20 22:15:05 | [diff] [blame] | 9 | #include <string> |
10 | |||||
[email protected] | 4447016b | 2013-02-23 19:07:44 | [diff] [blame] | 11 | #include "base/memory/ref_counted.h" |
gab | bf77513a | 2017-06-01 14:35:34 | [diff] [blame] | 12 | #include "base/sequence_checker.h" |
[email protected] | 4447016b | 2013-02-23 19:07:44 | [diff] [blame] | 13 | |
14 | namespace base { | ||||
15 | class SingleThreadTaskRunner; | ||||
[email protected] | 8c83a71c | 2013-12-16 18:02:58 | [diff] [blame] | 16 | } // namespace base |
17 | |||||
[email protected] | 4447016b | 2013-02-23 19:07:44 | [diff] [blame] | 18 | namespace remoting { |
19 | |||||
joedow | b7a9ca3 | 2016-12-23 00:15:25 | [diff] [blame] | 20 | class ScreenResolution; |
21 | |||||
[email protected] | 4447016b | 2013-02-23 19:07:44 | [diff] [blame] | 22 | // Establishes a loopback RDP connection to spawn a new Windows session. |
gab | bf77513a | 2017-06-01 14:35:34 | [diff] [blame] | 23 | class RdpClient { |
[email protected] | 4447016b | 2013-02-23 19:07:44 | [diff] [blame] | 24 | 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] | a4eca0a | 2013-06-20 22:15:05 | [diff] [blame] | 31 | virtual void OnRdpConnected() = 0; |
[email protected] | 4447016b | 2013-02-23 19:07:44 | [diff] [blame] | 32 | |
33 | // Notifies that the RDP connection has been closed. | ||||
34 | virtual void OnRdpClosed() = 0; | ||||
35 | }; | ||||
36 | |||||
joedow | 69094d5f | 2016-05-03 20:00:02 | [diff] [blame] | 37 | RdpClient(scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
38 | scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | ||||
joedow | b7a9ca3 | 2016-12-23 00:15:25 | [diff] [blame] | 39 | const ScreenResolution& resolution, |
joedow | 69094d5f | 2016-05-03 20:00:02 | [diff] [blame] | 40 | const std::string& terminal_id, |
41 | DWORD port_number, | ||||
42 | EventHandler* event_handler); | ||||
Peter Boström | e9178e4 | 2021-09-22 18:11:49 | [diff] [blame] | 43 | |
44 | RdpClient(const RdpClient&) = delete; | ||||
45 | RdpClient& operator=(const RdpClient&) = delete; | ||||
46 | |||||
[email protected] | 4447016b | 2013-02-23 19:07:44 | [diff] [blame] | 47 | virtual ~RdpClient(); |
48 | |||||
[email protected] | 97328ee | 2013-06-04 06:46:59 | [diff] [blame] | 49 | // Sends Secure Attention Sequence to the session. |
50 | void InjectSas(); | ||||
51 | |||||
joedow | b7a9ca3 | 2016-12-23 00:15:25 | [diff] [blame] | 52 | // Change the resolution of the desktop. |
53 | void ChangeResolution(const ScreenResolution& resolution); | ||||
54 | |||||
[email protected] | 4447016b | 2013-02-23 19:07:44 | [diff] [blame] | 55 | private: |
56 | // The actual implementation resides in Core class. | ||||
57 | class Core; | ||||
58 | scoped_refptr<Core> core_; | ||||
59 | |||||
gab | bf77513a | 2017-06-01 14:35:34 | [diff] [blame] | 60 | SEQUENCE_CHECKER(sequence_checker_); |
[email protected] | 4447016b | 2013-02-23 19:07:44 | [diff] [blame] | 61 | }; |
62 | |||||
63 | } // namespace remoting | ||||
64 | |||||
65 | #endif // REMOTING_HOST_WIN_RDP_CLIENT_H_ |