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