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 <list> | 10 #include <list> |
(...skipping 15 matching lines...) Expand all Loading... | |
26 } // namespace base | 26 } // namespace base |
27 | 27 |
28 namespace remoting { | 28 namespace remoting { |
29 | 29 |
30 namespace protocol { | 30 namespace protocol { |
31 class TransportFactory; | 31 class TransportFactory; |
32 } // namespace protocol | 32 } // namespace protocol |
33 | 33 |
34 class AudioDecodeScheduler; | 34 class AudioDecodeScheduler; |
35 class AudioPlayer; | 35 class AudioPlayer; |
36 class Capabilities; | |
36 class ClientContext; | 37 class ClientContext; |
37 class ClientUserInterface; | 38 class ClientUserInterface; |
38 class FrameConsumerProxy; | 39 class FrameConsumerProxy; |
39 class FrameProducer; | 40 class FrameProducer; |
40 class RectangleUpdateDecoder; | 41 class RectangleUpdateDecoder; |
41 | 42 |
42 class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback, | 43 class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback, |
43 public protocol::ClientStub { | 44 public protocol::ClientStub { |
44 public: | 45 public: |
45 ChromotingClient(const ClientConfig& config, | 46 ChromotingClient(const ClientConfig& config, |
46 ClientContext* client_context, | 47 ClientContext* client_context, |
47 protocol::ConnectionToHost* connection, | 48 protocol::ConnectionToHost* connection, |
48 ClientUserInterface* user_interface, | 49 ClientUserInterface* user_interface, |
49 scoped_refptr<FrameConsumerProxy> frame_consumer, | 50 scoped_refptr<FrameConsumerProxy> frame_consumer, |
50 scoped_ptr<AudioPlayer> audio_player); | 51 scoped_ptr<AudioPlayer> audio_player); |
51 | 52 |
52 virtual ~ChromotingClient(); | 53 virtual ~ChromotingClient(); |
53 | 54 |
54 // Start/stop the client. Must be called on the main thread. | 55 // Start/stop the client. Must be called on the main thread. |
55 void Start(scoped_refptr<XmppProxy> xmpp_proxy, | 56 void Start(scoped_refptr<XmppProxy> xmpp_proxy, |
56 scoped_ptr<protocol::TransportFactory> transport_factory); | 57 scoped_ptr<protocol::TransportFactory> transport_factory); |
57 void Stop(const base::Closure& shutdown_task); | 58 void Stop(const base::Closure& shutdown_task); |
58 | 59 |
59 FrameProducer* GetFrameProducer(); | 60 FrameProducer* GetFrameProducer(); |
60 | 61 |
61 // Return the stats recorded by this client. | 62 // Return the stats recorded by this client. |
62 ChromotingStats* GetStats(); | 63 ChromotingStats* GetStats(); |
63 | 64 |
65 // ClientStub implementation. | |
66 virtual void SetCapabilities(const protocol::Capabilities& capabilities) | |
67 OVERRIDE; | |
Sergey Ulanov
2013/04/16 08:38:53
nit: I think the right way to format this code is
alexeypa (please no reviews)
2013/04/16 22:06:11
Done.
| |
68 | |
64 // ClipboardStub implementation for receiving clipboard data from host. | 69 // ClipboardStub implementation for receiving clipboard data from host. |
65 virtual void InjectClipboardEvent(const protocol::ClipboardEvent& event) | 70 virtual void InjectClipboardEvent(const protocol::ClipboardEvent& event) |
66 OVERRIDE; | 71 OVERRIDE; |
67 | 72 |
68 // CursorShapeStub implementation for receiving cursor shape updates. | 73 // CursorShapeStub implementation for receiving cursor shape updates. |
69 virtual void SetCursorShape(const protocol::CursorShapeInfo& cursor_shape) | 74 virtual void SetCursorShape(const protocol::CursorShapeInfo& cursor_shape) |
70 OVERRIDE; | 75 OVERRIDE; |
71 | 76 |
72 // ConnectionToHost::HostEventCallback implementation. | 77 // ConnectionToHost::HostEventCallback implementation. |
73 virtual void OnConnectionState( | 78 virtual void OnConnectionState( |
(...skipping 12 matching lines...) Expand all Loading... | |
86 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 91 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
87 protocol::ConnectionToHost* connection_; | 92 protocol::ConnectionToHost* connection_; |
88 ClientUserInterface* user_interface_; | 93 ClientUserInterface* user_interface_; |
89 scoped_refptr<RectangleUpdateDecoder> rectangle_decoder_; | 94 scoped_refptr<RectangleUpdateDecoder> rectangle_decoder_; |
90 | 95 |
91 scoped_ptr<AudioDecodeScheduler> audio_decode_scheduler_; | 96 scoped_ptr<AudioDecodeScheduler> audio_decode_scheduler_; |
92 | 97 |
93 // If non-NULL, this is called when the client is done. | 98 // If non-NULL, this is called when the client is done. |
94 base::Closure client_done_; | 99 base::Closure client_done_; |
95 | 100 |
101 // The set of all capabilities supported by the host. | |
102 scoped_ptr<Capabilities> host_capabilities_; | |
103 | |
96 // Record the statistics of the connection. | 104 // Record the statistics of the connection. |
97 ChromotingStats stats_; | 105 ChromotingStats stats_; |
98 | 106 |
99 // WeakPtr used to avoid tasks accessing the client after it is deleted. | 107 // WeakPtr used to avoid tasks accessing the client after it is deleted. |
100 base::WeakPtrFactory<ChromotingClient> weak_factory_; | 108 base::WeakPtrFactory<ChromotingClient> weak_factory_; |
101 base::WeakPtr<ChromotingClient> weak_ptr_; | 109 base::WeakPtr<ChromotingClient> weak_ptr_; |
102 | 110 |
103 DISALLOW_COPY_AND_ASSIGN(ChromotingClient); | 111 DISALLOW_COPY_AND_ASSIGN(ChromotingClient); |
104 }; | 112 }; |
105 | 113 |
106 } // namespace remoting | 114 } // namespace remoting |
107 | 115 |
108 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_H_ | 116 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_H_ |
OLD | NEW |