| 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 <stdint.h> | 8 #include <cstdint> |
| 9 | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/sequenced_task_runner_helpers.h" | 15 #include "base/sequenced_task_runner_helpers.h" |
| 16 #include "base/threading/non_thread_safe.h" | 16 #include "base/threading/non_thread_safe.h" |
| 17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "base/timer/timer.h" | 18 #include "base/timer/timer.h" |
| 19 #include "remoting/host/client_session_control.h" | 19 #include "remoting/host/client_session_control.h" |
| 20 #include "remoting/host/client_session_details.h" |
| 20 #include "remoting/host/host_extension_session_manager.h" | 21 #include "remoting/host/host_extension_session_manager.h" |
| 21 #include "remoting/host/remote_input_filter.h" | 22 #include "remoting/host/remote_input_filter.h" |
| 22 #include "remoting/protocol/clipboard_echo_filter.h" | 23 #include "remoting/protocol/clipboard_echo_filter.h" |
| 23 #include "remoting/protocol/clipboard_filter.h" | 24 #include "remoting/protocol/clipboard_filter.h" |
| 24 #include "remoting/protocol/clipboard_stub.h" | 25 #include "remoting/protocol/clipboard_stub.h" |
| 25 #include "remoting/protocol/connection_to_client.h" | 26 #include "remoting/protocol/connection_to_client.h" |
| 26 #include "remoting/protocol/host_stub.h" | 27 #include "remoting/protocol/host_stub.h" |
| 27 #include "remoting/protocol/input_event_tracker.h" | 28 #include "remoting/protocol/input_event_tracker.h" |
| 28 #include "remoting/protocol/input_filter.h" | 29 #include "remoting/protocol/input_filter.h" |
| 29 #include "remoting/protocol/input_stub.h" | 30 #include "remoting/protocol/input_stub.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 48 namespace protocol { | 49 namespace protocol { |
| 49 class VideoLayout; | 50 class VideoLayout; |
| 50 } // namespace protocol | 51 } // namespace protocol |
| 51 | 52 |
| 52 // A ClientSession keeps a reference to a connection to a client, and maintains | 53 // A ClientSession keeps a reference to a connection to a client, and maintains |
| 53 // per-client state. | 54 // per-client state. |
| 54 class ClientSession : public base::NonThreadSafe, | 55 class ClientSession : public base::NonThreadSafe, |
| 55 public protocol::HostStub, | 56 public protocol::HostStub, |
| 56 public protocol::ConnectionToClient::EventHandler, | 57 public protocol::ConnectionToClient::EventHandler, |
| 57 public protocol::VideoStream::Observer, | 58 public protocol::VideoStream::Observer, |
| 58 public ClientSessionControl { | 59 public ClientSessionControl, |
| 60 public ClientSessionDetails { |
| 59 public: | 61 public: |
| 60 // Callback interface for passing events to the ChromotingHost. | 62 // Callback interface for passing events to the ChromotingHost. |
| 61 class EventHandler { | 63 class EventHandler { |
| 62 public: | 64 public: |
| 63 // Called after authentication has started. | 65 // Called after authentication has started. |
| 64 virtual void OnSessionAuthenticating(ClientSession* client) = 0; | 66 virtual void OnSessionAuthenticating(ClientSession* client) = 0; |
| 65 | 67 |
| 66 // Called after authentication has finished successfully. | 68 // Called after authentication has finished successfully. |
| 67 virtual void OnSessionAuthenticated(ClientSession* client) = 0; | 69 virtual void OnSessionAuthenticated(ClientSession* client) = 0; |
| 68 | 70 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 void OnRouteChange(protocol::ConnectionToClient* connection, | 129 void OnRouteChange(protocol::ConnectionToClient* connection, |
| 128 const std::string& channel_name, | 130 const std::string& channel_name, |
| 129 const protocol::TransportRoute& route) override; | 131 const protocol::TransportRoute& route) override; |
| 130 | 132 |
| 131 // ClientSessionControl interface. | 133 // ClientSessionControl interface. |
| 132 const std::string& client_jid() const override; | 134 const std::string& client_jid() const override; |
| 133 void DisconnectSession(protocol::ErrorCode error) override; | 135 void DisconnectSession(protocol::ErrorCode error) override; |
| 134 void OnLocalMouseMoved(const webrtc::DesktopVector& position) override; | 136 void OnLocalMouseMoved(const webrtc::DesktopVector& position) override; |
| 135 void SetDisableInputs(bool disable_inputs) override; | 137 void SetDisableInputs(bool disable_inputs) override; |
| 136 | 138 |
| 139 // ClientSessionDetails interface. |
| 140 uint32_t desktop_session_id() const override; |
| 141 |
| 137 protocol::ConnectionToClient* connection() const { return connection_.get(); } | 142 protocol::ConnectionToClient* connection() const { return connection_.get(); } |
| 138 | 143 |
| 139 bool is_authenticated() { return is_authenticated_; } | 144 bool is_authenticated() { return is_authenticated_; } |
| 140 | 145 |
| 141 const std::string* client_capabilities() const { | 146 const std::string* client_capabilities() const { |
| 142 return client_capabilities_.get(); | 147 return client_capabilities_.get(); |
| 143 } | 148 } |
| 144 | 149 |
| 145 private: | 150 private: |
| 146 // Creates a proxy for sending clipboard events to the client. | 151 // Creates a proxy for sending clipboard events to the client. |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 // Used to disable callbacks to |this| once DisconnectSession() has been | 252 // Used to disable callbacks to |this| once DisconnectSession() has been |
| 248 // called. | 253 // called. |
| 249 base::WeakPtrFactory<ClientSessionControl> weak_factory_; | 254 base::WeakPtrFactory<ClientSessionControl> weak_factory_; |
| 250 | 255 |
| 251 DISALLOW_COPY_AND_ASSIGN(ClientSession); | 256 DISALLOW_COPY_AND_ASSIGN(ClientSession); |
| 252 }; | 257 }; |
| 253 | 258 |
| 254 } // namespace remoting | 259 } // namespace remoting |
| 255 | 260 |
| 256 #endif // REMOTING_HOST_CLIENT_SESSION_H_ | 261 #endif // REMOTING_HOST_CLIENT_SESSION_H_ |
| OLD | NEW |