| 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 // ChromotingClient is the controller for the Client implementation. | 5 // ChromotingClient is the controller for the Client implementation. |
| 6 | 6 |
| 7 #ifndef REMOTING_CLIENT_CHROMOTING_CLIENT_H_ | 7 #ifndef REMOTING_CLIENT_CHROMOTING_CLIENT_H_ |
| 8 #define REMOTING_CLIENT_CHROMOTING_CLIENT_H_ | 8 #define REMOTING_CLIENT_CHROMOTING_CLIENT_H_ |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "remoting/protocol/client_stub.h" | 15 #include "remoting/protocol/client_stub.h" |
| 16 #include "remoting/protocol/clipboard_stub.h" | 16 #include "remoting/protocol/clipboard_stub.h" |
| 17 #include "remoting/protocol/connection_to_host.h" | 17 #include "remoting/protocol/connection_to_host.h" |
| 18 #include "remoting/protocol/input_stub.h" | 18 #include "remoting/protocol/input_stub.h" |
| 19 #include "remoting/protocol/negotiating_client_authenticator.h" |
| 19 #include "remoting/protocol/performance_tracker.h" | 20 #include "remoting/protocol/performance_tracker.h" |
| 20 #include "remoting/protocol/session_config.h" | 21 #include "remoting/protocol/session_config.h" |
| 21 #include "remoting/protocol/video_stub.h" | 22 #include "remoting/protocol/video_stub.h" |
| 22 #include "remoting/signaling/signal_strategy.h" | 23 #include "remoting/signaling/signal_strategy.h" |
| 23 | 24 |
| 24 namespace base { | 25 namespace base { |
| 25 class SingleThreadTaskRunner; | 26 class SingleThreadTaskRunner; |
| 26 } // namespace base | 27 } // namespace base |
| 27 | 28 |
| 28 namespace remoting { | 29 namespace remoting { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 56 | 57 |
| 57 void set_protocol_config(scoped_ptr<protocol::CandidateSessionConfig> config); | 58 void set_protocol_config(scoped_ptr<protocol::CandidateSessionConfig> config); |
| 58 | 59 |
| 59 // Used to set fake/mock objects for tests which use the ChromotingClient. | 60 // Used to set fake/mock objects for tests which use the ChromotingClient. |
| 60 void SetConnectionToHostForTests( | 61 void SetConnectionToHostForTests( |
| 61 scoped_ptr<protocol::ConnectionToHost> connection_to_host); | 62 scoped_ptr<protocol::ConnectionToHost> connection_to_host); |
| 62 | 63 |
| 63 // Start the client. Must be called on the main thread. |signal_strategy| | 64 // Start the client. Must be called on the main thread. |signal_strategy| |
| 64 // must outlive the client. | 65 // must outlive the client. |
| 65 void Start(SignalStrategy* signal_strategy, | 66 void Start(SignalStrategy* signal_strategy, |
| 66 scoped_ptr<protocol::Authenticator> authenticator, | 67 const protocol::ClientAuthenticationConfig& client_auth_config, |
| 67 scoped_refptr<protocol::TransportContext> transport_context, | 68 scoped_refptr<protocol::TransportContext> transport_context, |
| 68 const std::string& host_jid, | 69 const std::string& host_jid, |
| 69 const std::string& capabilities); | 70 const std::string& capabilities); |
| 70 | 71 |
| 71 protocol::ConnectionToHost::State connection_state() const { | 72 protocol::ConnectionToHost::State connection_state() const { |
| 72 return connection_->state(); | 73 return connection_->state(); |
| 73 } | 74 } |
| 74 | 75 |
| 75 protocol::ClipboardStub* clipboard_forwarder() { | 76 protocol::ClipboardStub* clipboard_forwarder() { |
| 76 return connection_->clipboard_forwarder(); | 77 return connection_->clipboard_forwarder(); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 base::ThreadChecker thread_checker_; | 115 base::ThreadChecker thread_checker_; |
| 115 | 116 |
| 116 scoped_ptr<protocol::CandidateSessionConfig> protocol_config_; | 117 scoped_ptr<protocol::CandidateSessionConfig> protocol_config_; |
| 117 | 118 |
| 118 // The following are not owned by this class. | 119 // The following are not owned by this class. |
| 119 ClientUserInterface* user_interface_ = nullptr; | 120 ClientUserInterface* user_interface_ = nullptr; |
| 120 protocol::VideoRenderer* video_renderer_ = nullptr; | 121 protocol::VideoRenderer* video_renderer_ = nullptr; |
| 121 SignalStrategy* signal_strategy_ = nullptr; | 122 SignalStrategy* signal_strategy_ = nullptr; |
| 122 | 123 |
| 123 std::string host_jid_; | 124 std::string host_jid_; |
| 124 scoped_ptr<protocol::Authenticator> authenticator_; | 125 protocol::ClientAuthenticationConfig client_auth_config_; |
| 125 scoped_refptr<protocol::TransportContext> transport_context_; | 126 scoped_refptr<protocol::TransportContext> transport_context_; |
| 126 | 127 |
| 127 scoped_ptr<protocol::SessionManager> session_manager_; | 128 scoped_ptr<protocol::SessionManager> session_manager_; |
| 128 scoped_ptr<protocol::ConnectionToHost> connection_; | 129 scoped_ptr<protocol::ConnectionToHost> connection_; |
| 129 | 130 |
| 130 scoped_ptr<AudioDecodeScheduler> audio_decode_scheduler_; | 131 scoped_ptr<AudioDecodeScheduler> audio_decode_scheduler_; |
| 131 | 132 |
| 132 std::string local_capabilities_; | 133 std::string local_capabilities_; |
| 133 | 134 |
| 134 // The set of all capabilities supported by the host. | 135 // The set of all capabilities supported by the host. |
| 135 std::string host_capabilities_; | 136 std::string host_capabilities_; |
| 136 | 137 |
| 137 // True if |protocol::Capabilities| message has been received. | 138 // True if |protocol::Capabilities| message has been received. |
| 138 bool host_capabilities_received_ = false; | 139 bool host_capabilities_received_ = false; |
| 139 | 140 |
| 140 // Record the statistics of the connection. | 141 // Record the statistics of the connection. |
| 141 protocol::PerformanceTracker perf_tracker_; | 142 protocol::PerformanceTracker perf_tracker_; |
| 142 | 143 |
| 143 DISALLOW_COPY_AND_ASSIGN(ChromotingClient); | 144 DISALLOW_COPY_AND_ASSIGN(ChromotingClient); |
| 144 }; | 145 }; |
| 145 | 146 |
| 146 } // namespace remoting | 147 } // namespace remoting |
| 147 | 148 |
| 148 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_H_ | 149 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_H_ |
| OLD | NEW |