OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CLIENT_SESSION_H_ | 5 #ifndef REMOTING_HOST_CLIENT_SESSION_H_ |
6 #define REMOTING_HOST_CLIENT_SESSION_H_ | 6 #define REMOTING_HOST_CLIENT_SESSION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 void OnLocalMouseMoved(const webrtc::DesktopVector& position) override; | 134 void OnLocalMouseMoved(const webrtc::DesktopVector& position) override; |
135 void SetDisableInputs(bool disable_inputs) override; | 135 void SetDisableInputs(bool disable_inputs) override; |
136 void ResetVideoPipeline() override; | 136 void ResetVideoPipeline() override; |
137 | 137 |
138 void SetGnubbyAuthHandlerForTesting(GnubbyAuthHandler* gnubby_auth_handler); | 138 void SetGnubbyAuthHandlerForTesting(GnubbyAuthHandler* gnubby_auth_handler); |
139 | 139 |
140 protocol::ConnectionToClient* connection() const { | 140 protocol::ConnectionToClient* connection() const { |
141 return connection_.get(); | 141 return connection_.get(); |
142 } | 142 } |
143 | 143 |
144 bool is_authenticated() { return auth_input_filter_.enabled(); } | 144 bool is_authenticated() { return is_authenticated_; } |
145 | 145 |
146 const std::string* client_capabilities() const { | 146 const std::string* client_capabilities() const { |
147 return client_capabilities_.get(); | 147 return client_capabilities_.get(); |
148 } | 148 } |
149 | 149 |
150 private: | 150 private: |
151 // Creates a proxy for sending clipboard events to the client. | 151 // Creates a proxy for sending clipboard events to the client. |
152 scoped_ptr<protocol::ClipboardStub> CreateClipboardProxy(); | 152 scoped_ptr<protocol::ClipboardStub> CreateClipboardProxy(); |
153 | 153 |
154 EventHandler* event_handler_; | 154 EventHandler* event_handler_; |
(...skipping 23 matching lines...) Expand all Loading... |
178 | 178 |
179 // Filter to used to stop clipboard items sent from the client being echoed | 179 // Filter to used to stop clipboard items sent from the client being echoed |
180 // back to it. It is the final element in the clipboard (client -> host) | 180 // back to it. It is the final element in the clipboard (client -> host) |
181 // pipeline. | 181 // pipeline. |
182 protocol::ClipboardEchoFilter clipboard_echo_filter_; | 182 protocol::ClipboardEchoFilter clipboard_echo_filter_; |
183 | 183 |
184 // Filters used to manage enabling & disabling of input & clipboard. | 184 // Filters used to manage enabling & disabling of input & clipboard. |
185 protocol::InputFilter disable_input_filter_; | 185 protocol::InputFilter disable_input_filter_; |
186 protocol::ClipboardFilter disable_clipboard_filter_; | 186 protocol::ClipboardFilter disable_clipboard_filter_; |
187 | 187 |
188 // Filters used to disable input & clipboard when we're not authenticated. | |
189 protocol::InputFilter auth_input_filter_; | |
190 protocol::ClipboardFilter auth_clipboard_filter_; | |
191 | |
192 // Factory for weak pointers to the client clipboard stub. | 188 // Factory for weak pointers to the client clipboard stub. |
193 // This must appear after |clipboard_echo_filter_|, so that it won't outlive | 189 // This must appear after |clipboard_echo_filter_|, so that it won't outlive |
194 // it. | 190 // it. |
195 base::WeakPtrFactory<protocol::ClipboardStub> client_clipboard_factory_; | 191 base::WeakPtrFactory<protocol::ClipboardStub> client_clipboard_factory_; |
196 | 192 |
197 // The maximum duration of this session. | 193 // The maximum duration of this session. |
198 // There is no maximum if this value is <= 0. | 194 // There is no maximum if this value is <= 0. |
199 base::TimeDelta max_duration_; | 195 base::TimeDelta max_duration_; |
200 | 196 |
201 // A timer that triggers a disconnect when the maximum session duration | 197 // A timer that triggers a disconnect when the maximum session duration |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 | 229 |
234 // The pairing registry for PIN-less authentication. | 230 // The pairing registry for PIN-less authentication. |
235 scoped_refptr<protocol::PairingRegistry> pairing_registry_; | 231 scoped_refptr<protocol::PairingRegistry> pairing_registry_; |
236 | 232 |
237 // Used to proxy gnubby auth traffic. | 233 // Used to proxy gnubby auth traffic. |
238 scoped_ptr<GnubbyAuthHandler> gnubby_auth_handler_; | 234 scoped_ptr<GnubbyAuthHandler> gnubby_auth_handler_; |
239 | 235 |
240 // Used to manage extension functionality. | 236 // Used to manage extension functionality. |
241 scoped_ptr<HostExtensionSessionManager> extension_manager_; | 237 scoped_ptr<HostExtensionSessionManager> extension_manager_; |
242 | 238 |
| 239 // Set to true if the client was authenticated successfully. |
| 240 bool is_authenticated_; |
| 241 |
243 // Used to store video channel pause & lossless parameters. | 242 // Used to store video channel pause & lossless parameters. |
244 bool pause_video_; | 243 bool pause_video_; |
245 bool lossless_video_encode_; | 244 bool lossless_video_encode_; |
246 bool lossless_video_color_; | 245 bool lossless_video_color_; |
247 | 246 |
248 // Used to disable callbacks to |this| once DisconnectSession() has been | 247 // Used to disable callbacks to |this| once DisconnectSession() has been |
249 // called. | 248 // called. |
250 base::WeakPtrFactory<ClientSessionControl> weak_factory_; | 249 base::WeakPtrFactory<ClientSessionControl> weak_factory_; |
251 | 250 |
252 DISALLOW_COPY_AND_ASSIGN(ClientSession); | 251 DISALLOW_COPY_AND_ASSIGN(ClientSession); |
253 }; | 252 }; |
254 | 253 |
255 } // namespace remoting | 254 } // namespace remoting |
256 | 255 |
257 #endif // REMOTING_HOST_CLIENT_SESSION_H_ | 256 #endif // REMOTING_HOST_CLIENT_SESSION_H_ |
OLD | NEW |