| 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 <cstdint> | 8 #include <cstdint> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 // |event_handler| and |desktop_environment_factory| must outlive |this|. | 91 // |event_handler| and |desktop_environment_factory| must outlive |this|. |
| 92 // All |HostExtension|s in |extensions| must outlive |this|. | 92 // All |HostExtension|s in |extensions| must outlive |this|. |
| 93 ClientSession( | 93 ClientSession( |
| 94 EventHandler* event_handler, | 94 EventHandler* event_handler, |
| 95 std::unique_ptr<protocol::ConnectionToClient> connection, | 95 std::unique_ptr<protocol::ConnectionToClient> connection, |
| 96 DesktopEnvironmentFactory* desktop_environment_factory, | 96 DesktopEnvironmentFactory* desktop_environment_factory, |
| 97 const DesktopEnvironmentOptions& desktop_environment_options, | 97 const DesktopEnvironmentOptions& desktop_environment_options, |
| 98 const base::TimeDelta& max_duration, | 98 const base::TimeDelta& max_duration, |
| 99 scoped_refptr<protocol::PairingRegistry> pairing_registry, | 99 scoped_refptr<protocol::PairingRegistry> pairing_registry, |
| 100 const std::vector<HostExtension*>& extensions, | 100 const std::vector<HostExtension*>& extensions); |
| 101 const std::vector<protocol::DataChannelManager::NameCallbackPair>& | |
| 102 data_channel_callbacks); | |
| 103 ~ClientSession() override; | 101 ~ClientSession() override; |
| 104 | 102 |
| 105 // Returns the set of capabilities negotiated between client and host. | 103 // Returns the set of capabilities negotiated between client and host. |
| 106 const std::string& capabilities() const { return capabilities_; } | 104 const std::string& capabilities() const { return capabilities_; } |
| 107 | 105 |
| 108 // protocol::HostStub interface. | 106 // protocol::HostStub interface. |
| 109 void NotifyClientResolution( | 107 void NotifyClientResolution( |
| 110 const protocol::ClientResolution& resolution) override; | 108 const protocol::ClientResolution& resolution) override; |
| 111 void ControlVideo(const protocol::VideoControl& video_control) override; | 109 void ControlVideo(const protocol::VideoControl& video_control) override; |
| 112 void ControlAudio(const protocol::AudioControl& audio_control) override; | 110 void ControlAudio(const protocol::AudioControl& audio_control) override; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 138 ClientSessionControl* session_control() override; | 136 ClientSessionControl* session_control() override; |
| 139 | 137 |
| 140 protocol::ConnectionToClient* connection() const { return connection_.get(); } | 138 protocol::ConnectionToClient* connection() const { return connection_.get(); } |
| 141 | 139 |
| 142 bool is_authenticated() { return is_authenticated_; } | 140 bool is_authenticated() { return is_authenticated_; } |
| 143 | 141 |
| 144 const std::string* client_capabilities() const { | 142 const std::string* client_capabilities() const { |
| 145 return client_capabilities_.get(); | 143 return client_capabilities_.get(); |
| 146 } | 144 } |
| 147 | 145 |
| 146 void RegisterDataChannelManagerCallback( |
| 147 const std::string& prefix, |
| 148 protocol::DataChannelManager::CreateHandlerCallback constructor); |
| 149 |
| 148 void SetEventTimestampsSourceForTests( | 150 void SetEventTimestampsSourceForTests( |
| 149 scoped_refptr<protocol::InputEventTimestampsSource> | 151 scoped_refptr<protocol::InputEventTimestampsSource> |
| 150 event_timestamp_source); | 152 event_timestamp_source); |
| 151 | 153 |
| 152 private: | 154 private: |
| 153 // Creates a proxy for sending clipboard events to the client. | 155 // Creates a proxy for sending clipboard events to the client. |
| 154 std::unique_ptr<protocol::ClipboardStub> CreateClipboardProxy(); | 156 std::unique_ptr<protocol::ClipboardStub> CreateClipboardProxy(); |
| 155 | 157 |
| 156 // protocol::VideoStream::Observer implementation. | 158 // protocol::VideoStream::Observer implementation. |
| 157 void OnVideoSizeChanged(protocol::VideoStream* stream, | 159 void OnVideoSizeChanged(protocol::VideoStream* stream, |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 // Used to disable callbacks to |this| once DisconnectSession() has been | 264 // Used to disable callbacks to |this| once DisconnectSession() has been |
| 263 // called. | 265 // called. |
| 264 base::WeakPtrFactory<ClientSessionControl> weak_factory_; | 266 base::WeakPtrFactory<ClientSessionControl> weak_factory_; |
| 265 | 267 |
| 266 DISALLOW_COPY_AND_ASSIGN(ClientSession); | 268 DISALLOW_COPY_AND_ASSIGN(ClientSession); |
| 267 }; | 269 }; |
| 268 | 270 |
| 269 } // namespace remoting | 271 } // namespace remoting |
| 270 | 272 |
| 271 #endif // REMOTING_HOST_CLIENT_SESSION_H_ | 273 #endif // REMOTING_HOST_CLIENT_SESSION_H_ |
| OLD | NEW |