OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_HOST_WIN_RDP_CLIENT_H_ | 5 #ifndef REMOTING_HOST_WIN_RDP_CLIENT_H_ |
6 #define REMOTING_HOST_WIN_RDP_CLIENT_H_ | 6 #define REMOTING_HOST_WIN_RDP_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/threading/non_thread_safe.h" | 13 #include "base/threading/non_thread_safe.h" |
14 #include "third_party/skia/include/core/SkSize.h" | |
15 | 14 |
16 namespace base { | 15 namespace base { |
17 class SingleThreadTaskRunner; | 16 class SingleThreadTaskRunner; |
18 } // namespace | 17 } // namespace |
19 | 18 |
20 namespace remoting { | 19 namespace remoting { |
21 | 20 |
22 // Establishes a loopback RDP connection to spawn a new Windows session. | 21 // Establishes a loopback RDP connection to spawn a new Windows session. |
23 class RdpClient : public base::NonThreadSafe { | 22 class RdpClient : public base::NonThreadSafe { |
24 public: | 23 public: |
25 class EventHandler { | 24 class EventHandler { |
26 public: | 25 public: |
27 virtual ~EventHandler() {} | 26 virtual ~EventHandler() {} |
28 | 27 |
29 // Notifies the event handler that an RDP connection has been established | 28 // Notifies the event handler that an RDP connection has been established |
30 // successfully. | 29 // successfully. |
31 virtual void OnRdpConnected() = 0; | 30 virtual void OnRdpConnected() = 0; |
32 | 31 |
33 // Notifies that the RDP connection has been closed. | 32 // Notifies that the RDP connection has been closed. |
34 virtual void OnRdpClosed() = 0; | 33 virtual void OnRdpClosed() = 0; |
35 }; | 34 }; |
36 | 35 |
37 RdpClient( | 36 RdpClient( |
38 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 37 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
39 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 38 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
40 const SkISize& screen_size, | 39 const webrtc::DesktopSize& screen_size, |
41 const std::string& terminal_id, | 40 const std::string& terminal_id, |
42 EventHandler* event_handler); | 41 EventHandler* event_handler); |
43 virtual ~RdpClient(); | 42 virtual ~RdpClient(); |
44 | 43 |
45 // Sends Secure Attention Sequence to the session. | 44 // Sends Secure Attention Sequence to the session. |
46 void InjectSas(); | 45 void InjectSas(); |
47 | 46 |
48 private: | 47 private: |
49 // The actual implementation resides in Core class. | 48 // The actual implementation resides in Core class. |
50 class Core; | 49 class Core; |
51 scoped_refptr<Core> core_; | 50 scoped_refptr<Core> core_; |
52 | 51 |
53 DISALLOW_COPY_AND_ASSIGN(RdpClient); | 52 DISALLOW_COPY_AND_ASSIGN(RdpClient); |
54 }; | 53 }; |
55 | 54 |
56 } // namespace remoting | 55 } // namespace remoting |
57 | 56 |
58 #endif // REMOTING_HOST_WIN_RDP_CLIENT_H_ | 57 #endif // REMOTING_HOST_WIN_RDP_CLIENT_H_ |
OLD | NEW |