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> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/time.h" | 13 #include "base/time.h" |
14 #include "remoting/base/scoped_thread_proxy.h" | 14 #include "remoting/base/scoped_thread_proxy.h" |
15 #include "remoting/client/client_config.h" | 15 #include "remoting/client/client_config.h" |
16 #include "remoting/client/chromoting_stats.h" | 16 #include "remoting/client/chromoting_stats.h" |
17 #include "remoting/client/chromoting_view.h" | 17 #include "remoting/client/chromoting_view.h" |
18 #include "remoting/protocol/client_stub.h" | 18 #include "remoting/protocol/client_stub.h" |
19 #include "remoting/protocol/clipboard_stub.h" | 19 #include "remoting/protocol/clipboard_stub.h" |
20 #include "remoting/protocol/cursor_shape_stub.h" | |
20 #include "remoting/protocol/connection_to_host.h" | 21 #include "remoting/protocol/connection_to_host.h" |
21 #include "remoting/protocol/input_stub.h" | 22 #include "remoting/protocol/input_stub.h" |
22 #include "remoting/protocol/video_stub.h" | 23 #include "remoting/protocol/video_stub.h" |
23 #include "remoting/jingle_glue/xmpp_proxy.h" | 24 #include "remoting/jingle_glue/xmpp_proxy.h" |
24 | 25 |
25 class MessageLoop; | 26 class MessageLoop; |
26 | 27 |
27 namespace remoting { | 28 namespace remoting { |
28 | 29 |
29 namespace protocol { | 30 namespace protocol { |
30 class TransportFactory; | 31 class TransportFactory; |
31 } // namespace protocol | 32 } // namespace protocol |
32 | 33 |
33 class ClientContext; | 34 class ClientContext; |
34 class RectangleUpdateDecoder; | 35 class RectangleUpdateDecoder; |
35 | 36 |
36 // TODO(sergeyu): Move VideoStub implementation to RectangleUpdateDecoder. | 37 // TODO(sergeyu): Move VideoStub implementation to RectangleUpdateDecoder. |
37 class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback, | 38 class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback, |
38 public protocol::ClientStub, | 39 public protocol::ClientStub, |
39 public protocol::ClipboardStub, | 40 public protocol::ClipboardStub, |
41 public protocol::CursorShapeStub, | |
Wez
2012/05/23 00:01:57
I don't think we actually need ChromotingClient to
garykac
2012/05/26 01:58:01
ChromotingClient currently has all the stubs for h
| |
40 public protocol::VideoStub { | 42 public protocol::VideoStub { |
41 public: | 43 public: |
42 // Objects passed in are not owned by this class. | 44 // Objects passed in are not owned by this class. |
43 ChromotingClient(const ClientConfig& config, | 45 ChromotingClient(const ClientConfig& config, |
44 ClientContext* context, | 46 ClientContext* context, |
45 protocol::ConnectionToHost* connection, | 47 protocol::ConnectionToHost* connection, |
46 ChromotingView* view, | 48 ChromotingView* view, |
47 RectangleUpdateDecoder* rectangle_decoder, | 49 RectangleUpdateDecoder* rectangle_decoder, |
48 const base::Closure& client_done); | 50 const base::Closure& client_done); |
49 virtual ~ChromotingClient(); | 51 virtual ~ChromotingClient(); |
50 | 52 |
51 void Start(scoped_refptr<XmppProxy> xmpp_proxy, | 53 void Start(scoped_refptr<XmppProxy> xmpp_proxy, |
52 scoped_ptr<protocol::TransportFactory> transport_factory); | 54 scoped_ptr<protocol::TransportFactory> transport_factory); |
53 void Stop(const base::Closure& shutdown_task); | 55 void Stop(const base::Closure& shutdown_task); |
54 void ClientDone(); | 56 void ClientDone(); |
55 | 57 |
56 // Return the stats recorded by this client. | 58 // Return the stats recorded by this client. |
57 ChromotingStats* GetStats(); | 59 ChromotingStats* GetStats(); |
58 | 60 |
59 // ClipboardStub implementation. | 61 // ClipboardStub implementation for receiving clipboard data from host. |
60 virtual void InjectClipboardEvent(const protocol::ClipboardEvent& event) | 62 virtual void InjectClipboardEvent(const protocol::ClipboardEvent& event) |
61 OVERRIDE; | 63 OVERRIDE; |
62 | 64 |
65 // CursorShapeStub implementation for receiving cursor shape updates. | |
66 virtual void SetCursorShape(const protocol::CursorShapeInfo& cursor_shape) | |
67 OVERRIDE; | |
68 | |
63 // ConnectionToHost::HostEventCallback implementation. | 69 // ConnectionToHost::HostEventCallback implementation. |
64 virtual void OnConnectionState( | 70 virtual void OnConnectionState( |
65 protocol::ConnectionToHost::State state, | 71 protocol::ConnectionToHost::State state, |
66 protocol::ErrorCode error) OVERRIDE; | 72 protocol::ErrorCode error) OVERRIDE; |
67 | 73 |
68 // VideoStub implementation. | 74 // VideoStub implementation. |
69 virtual void ProcessVideoPacket(scoped_ptr<VideoPacket> packet, | 75 virtual void ProcessVideoPacket(scoped_ptr<VideoPacket> packet, |
70 const base::Closure& done) OVERRIDE; | 76 const base::Closure& done) OVERRIDE; |
71 virtual int GetPendingPackets() OVERRIDE; | 77 virtual int GetPendingPackets() OVERRIDE; |
72 | 78 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 int64 last_sequence_number_; | 128 int64 last_sequence_number_; |
123 | 129 |
124 ScopedThreadProxy thread_proxy_; | 130 ScopedThreadProxy thread_proxy_; |
125 | 131 |
126 DISALLOW_COPY_AND_ASSIGN(ChromotingClient); | 132 DISALLOW_COPY_AND_ASSIGN(ChromotingClient); |
127 }; | 133 }; |
128 | 134 |
129 } // namespace remoting | 135 } // namespace remoting |
130 | 136 |
131 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_H_ | 137 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_H_ |
OLD | NEW |