[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 | |||||
avi | c5960f3 | 2015-12-22 22:49:48 | [diff] [blame] | 11 | #include "base/macros.h" |
[email protected] | 4447016b | 2013-02-23 19:07:44 | [diff] [blame] | 12 | #include "base/memory/ref_counted.h" |
[email protected] | 4447016b | 2013-02-23 19:07:44 | [diff] [blame] | 13 | #include "base/threading/non_thread_safe.h" |
14 | |||||
15 | namespace base { | ||||
16 | class SingleThreadTaskRunner; | ||||
[email protected] | 8c83a71c | 2013-12-16 18:02:58 | [diff] [blame] | 17 | } // namespace base |
18 | |||||
19 | namespace webrtc { | ||||
20 | class DesktopSize; | ||||
21 | } // namespace webrtc | ||||
[email protected] | 4447016b | 2013-02-23 19:07:44 | [diff] [blame] | 22 | |
[email protected] | 4447016b | 2013-02-23 19:07:44 | [diff] [blame] | 23 | namespace remoting { |
24 | |||||
25 | // Establishes a loopback RDP connection to spawn a new Windows session. | ||||
26 | class RdpClient : public base::NonThreadSafe { | ||||
27 | public: | ||||
28 | class EventHandler { | ||||
29 | public: | ||||
30 | virtual ~EventHandler() {} | ||||
31 | |||||
32 | // Notifies the event handler that an RDP connection has been established | ||||
33 | // successfully. | ||||
[email protected] | a4eca0a | 2013-06-20 22:15:05 | [diff] [blame] | 34 | virtual void OnRdpConnected() = 0; |
[email protected] | 4447016b | 2013-02-23 19:07:44 | [diff] [blame] | 35 | |
36 | // Notifies that the RDP connection has been closed. | ||||
37 | virtual void OnRdpClosed() = 0; | ||||
38 | }; | ||||
39 | |||||
40 | RdpClient( | ||||
41 | scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | ||||
42 | scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | ||||
[email protected] | 8c83a71c | 2013-12-16 18:02:58 | [diff] [blame] | 43 | const webrtc::DesktopSize& screen_size, |
[email protected] | a4eca0a | 2013-06-20 22:15:05 | [diff] [blame] | 44 | const std::string& terminal_id, |
[email protected] | 4447016b | 2013-02-23 19:07:44 | [diff] [blame] | 45 | EventHandler* event_handler); |
46 | virtual ~RdpClient(); | ||||
47 | |||||
[email protected] | 97328ee | 2013-06-04 06:46:59 | [diff] [blame] | 48 | // Sends Secure Attention Sequence to the session. |
49 | void InjectSas(); | ||||
50 | |||||
[email protected] | 4447016b | 2013-02-23 19:07:44 | [diff] [blame] | 51 | private: |
52 | // The actual implementation resides in Core class. | ||||
53 | class Core; | ||||
54 | scoped_refptr<Core> core_; | ||||
55 | |||||
56 | DISALLOW_COPY_AND_ASSIGN(RdpClient); | ||||
57 | }; | ||||
58 | |||||
59 | } // namespace remoting | ||||
60 | |||||
61 | #endif // REMOTING_HOST_WIN_RDP_CLIENT_H_ |