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/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "remoting/client/chromoting_stats.h" | 14 #include "remoting/client/chromoting_stats.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/video_stub.h" | 19 #include "remoting/protocol/video_stub.h" |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 class SingleThreadTaskRunner; | 22 class SingleThreadTaskRunner; |
23 } // namespace base | 23 } // namespace base |
24 | 24 |
25 namespace remoting { | 25 namespace remoting { |
26 | 26 |
27 namespace protocol { | 27 namespace protocol { |
| 28 class CandidateSessionConfig; |
28 class TransportFactory; | 29 class TransportFactory; |
29 } // namespace protocol | 30 } // namespace protocol |
30 | 31 |
31 class AudioDecodeScheduler; | 32 class AudioDecodeScheduler; |
32 class AudioPlayer; | 33 class AudioPlayer; |
33 class ClientContext; | 34 class ClientContext; |
34 class ClientUserInterface; | 35 class ClientUserInterface; |
35 class FrameConsumerProxy; | 36 class FrameConsumerProxy; |
36 class FrameProducer; | 37 class FrameProducer; |
37 class VideoRenderer; | 38 class VideoRenderer; |
38 class SignalStrategy; | 39 class SignalStrategy; |
39 | 40 |
40 class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback, | 41 class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback, |
41 public protocol::ClientStub { | 42 public protocol::ClientStub { |
42 public: | 43 public: |
43 // |audio_player| may be null, in which case audio will not be requested. | 44 // |audio_player| may be null, in which case audio will not be requested. |
44 ChromotingClient(ClientContext* client_context, | 45 ChromotingClient(ClientContext* client_context, |
45 ClientUserInterface* user_interface, | 46 ClientUserInterface* user_interface, |
46 VideoRenderer* video_renderer, | 47 VideoRenderer* video_renderer, |
47 scoped_ptr<AudioPlayer> audio_player); | 48 scoped_ptr<AudioPlayer> audio_player); |
48 | 49 |
49 virtual ~ChromotingClient(); | 50 virtual ~ChromotingClient(); |
50 | 51 |
| 52 void SetProtocolConfigForTests( |
| 53 scoped_ptr<protocol::CandidateSessionConfig> config); |
| 54 |
51 // Start the client. Must be called on the main thread. |signal_strategy| | 55 // Start the client. Must be called on the main thread. |signal_strategy| |
52 // must outlive the client. | 56 // must outlive the client. |
53 void Start(SignalStrategy* signal_strategy, | 57 void Start(SignalStrategy* signal_strategy, |
54 scoped_ptr<protocol::Authenticator> authenticator, | 58 scoped_ptr<protocol::Authenticator> authenticator, |
55 scoped_ptr<protocol::TransportFactory> transport_factory, | 59 scoped_ptr<protocol::TransportFactory> transport_factory, |
56 const std::string& host_jid, | 60 const std::string& host_jid, |
57 const std::string& capabilities); | 61 const std::string& capabilities); |
58 | 62 |
59 protocol::ConnectionToHost::State connection_state() const { | 63 protocol::ConnectionToHost::State connection_state() const { |
60 return connection_.state(); | 64 return connection_.state(); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 120 |
117 // Record the statistics of the connection. | 121 // Record the statistics of the connection. |
118 ChromotingStats stats_; | 122 ChromotingStats stats_; |
119 | 123 |
120 DISALLOW_COPY_AND_ASSIGN(ChromotingClient); | 124 DISALLOW_COPY_AND_ASSIGN(ChromotingClient); |
121 }; | 125 }; |
122 | 126 |
123 } // namespace remoting | 127 } // namespace remoting |
124 | 128 |
125 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_H_ | 129 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_H_ |
OLD | NEW |