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_HOST_WINDOW_H_ | 5 #ifndef REMOTING_HOST_WIN_RDP_HOST_WINDOW_H_ |
6 #define REMOTING_HOST_WIN_RDP_HOST_WINDOW_H_ | 6 #define REMOTING_HOST_WIN_RDP_HOST_WINDOW_H_ |
7 | 7 |
8 #include <atlbase.h> | 8 #include <atlbase.h> |
9 #include <atlcom.h> | 9 #include <atlcom.h> |
10 #include <atlcrack.h> | 10 #include <atlcrack.h> |
11 #include <atlctl.h> | 11 #include <atlctl.h> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
16 #include "base/win/scoped_comptr.h" | 16 #include "base/win/scoped_comptr.h" |
17 #include "net/base/ip_endpoint.h" | 17 #include "net/base/ip_endpoint.h" |
18 #include "third_party/skia/include/core/SkSize.h" | 18 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
19 | 19 |
20 #import "PROGID:MsTscAx.MsTscAx" \ | 20 #import "PROGID:MsTscAx.MsTscAx" \ |
21 exclude("wireHWND", "_RemotableHandle", "__MIDL_IWinTypes_0009"), \ | 21 exclude("wireHWND", "_RemotableHandle", "__MIDL_IWinTypes_0009"), \ |
22 rename_namespace("mstsc") raw_interfaces_only no_implementation | 22 rename_namespace("mstsc") raw_interfaces_only no_implementation |
23 | 23 |
24 namespace remoting { | 24 namespace remoting { |
25 | 25 |
26 // RdpClientWindow is used to establish a connection to the given RDP endpoint. | 26 // RdpClientWindow is used to establish a connection to the given RDP endpoint. |
27 // It is a GUI window class that hosts Microsoft RDP ActiveX control, which | 27 // It is a GUI window class that hosts Microsoft RDP ActiveX control, which |
28 // takes care of handling RDP properly. RdpClientWindow must be used only on | 28 // takes care of handling RDP properly. RdpClientWindow must be used only on |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // Specifies the endpoint to connect to and passes the event handler pointer | 65 // Specifies the endpoint to connect to and passes the event handler pointer |
66 // to be notified about connection events. | 66 // to be notified about connection events. |
67 RdpClientWindow(const net::IPEndPoint& server_endpoint, | 67 RdpClientWindow(const net::IPEndPoint& server_endpoint, |
68 const std::string& terminal_id, | 68 const std::string& terminal_id, |
69 EventHandler* event_handler); | 69 EventHandler* event_handler); |
70 ~RdpClientWindow(); | 70 ~RdpClientWindow(); |
71 | 71 |
72 // Creates the window along with the ActiveX control and initiates the | 72 // Creates the window along with the ActiveX control and initiates the |
73 // connection. |screen_size| specifies resolution of the screen. Returns false | 73 // connection. |screen_size| specifies resolution of the screen. Returns false |
74 // if an error occurs. | 74 // if an error occurs. |
75 bool Connect(const SkISize& screen_size); | 75 bool Connect(const webrtc::DesktopSize& screen_size); |
76 | 76 |
77 // Initiates shutdown of the connection. The caller must not delete |this| | 77 // Initiates shutdown of the connection. The caller must not delete |this| |
78 // until it receives OnDisconnected() notification. | 78 // until it receives OnDisconnected() notification. |
79 void Disconnect(); | 79 void Disconnect(); |
80 | 80 |
81 // Emulates pressing Ctrl+Alt+End combination that is translated to Secure | 81 // Emulates pressing Ctrl+Alt+End combination that is translated to Secure |
82 // Attention Sequence by the ActiveX control. | 82 // Attention Sequence by the ActiveX control. |
83 void InjectSas(); | 83 void InjectSas(); |
84 | 84 |
85 private: | 85 private: |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 // Wrappers for the event handler's methods that make sure that | 126 // Wrappers for the event handler's methods that make sure that |
127 // OnDisconnected() is the last notification delivered and is delevered | 127 // OnDisconnected() is the last notification delivered and is delevered |
128 // only once. | 128 // only once. |
129 void NotifyConnected(); | 129 void NotifyConnected(); |
130 void NotifyDisconnected(); | 130 void NotifyDisconnected(); |
131 | 131 |
132 // Invoked to report connect/disconnect events. | 132 // Invoked to report connect/disconnect events. |
133 EventHandler* event_handler_; | 133 EventHandler* event_handler_; |
134 | 134 |
135 // Contains the requested dimensions of the screen. | 135 // Contains the requested dimensions of the screen. |
136 SkISize screen_size_; | 136 webrtc::DesktopSize screen_size_; |
137 | 137 |
138 // The endpoint to connect to. | 138 // The endpoint to connect to. |
139 net::IPEndPoint server_endpoint_; | 139 net::IPEndPoint server_endpoint_; |
140 | 140 |
141 // The terminal ID assigned to this connection. | 141 // The terminal ID assigned to this connection. |
142 std::string terminal_id_; | 142 std::string terminal_id_; |
143 | 143 |
144 // Interfaces exposed by the RDP ActiveX control. | 144 // Interfaces exposed by the RDP ActiveX control. |
145 base::win::ScopedComPtr<mstsc::IMsRdpClient> client_; | 145 base::win::ScopedComPtr<mstsc::IMsRdpClient> client_; |
146 base::win::ScopedComPtr<mstsc::IMsRdpClientAdvancedSettings> client_settings_; | 146 base::win::ScopedComPtr<mstsc::IMsRdpClientAdvancedSettings> client_settings_; |
147 | 147 |
148 // Used to cancel modal dialog boxes shown by the RDP control. | 148 // Used to cancel modal dialog boxes shown by the RDP control. |
149 class WindowHook; | 149 class WindowHook; |
150 scoped_refptr<WindowHook> window_activate_hook_; | 150 scoped_refptr<WindowHook> window_activate_hook_; |
151 }; | 151 }; |
152 | 152 |
153 } // namespace remoting | 153 } // namespace remoting |
154 | 154 |
155 #endif // REMOTING_HOST_WIN_RDP_HOST_WINDOW_H_ | 155 #endif // REMOTING_HOST_WIN_RDP_HOST_WINDOW_H_ |
OLD | NEW |