| 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/connection_to_host.h" | 20 #include "remoting/protocol/connection_to_host.h" |
| 21 #include "remoting/protocol/input_stub.h" | 21 #include "remoting/protocol/input_stub.h" |
| 22 #include "remoting/protocol/video_stub.h" | 22 #include "remoting/protocol/video_stub.h" |
| 23 #include "remoting/jingle_glue/xmpp_proxy.h" | 23 #include "remoting/jingle_glue/xmpp_proxy.h" |
| 24 | 24 |
| 25 class MessageLoop; | 25 class MessageLoop; |
| 26 | 26 |
| 27 namespace remoting { | 27 namespace remoting { |
| 28 | 28 |
| 29 namespace protocol { |
| 30 class TransportFactory; |
| 31 } // namespace protocol |
| 32 |
| 29 class ClientContext; | 33 class ClientContext; |
| 30 class RectangleUpdateDecoder; | 34 class RectangleUpdateDecoder; |
| 31 | 35 |
| 32 // TODO(sergeyu): Move VideoStub implementation to RectangleUpdateDecoder. | 36 // TODO(sergeyu): Move VideoStub implementation to RectangleUpdateDecoder. |
| 33 class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback, | 37 class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback, |
| 34 public protocol::ClientStub, | 38 public protocol::ClientStub, |
| 35 public protocol::ClipboardStub, | 39 public protocol::ClipboardStub, |
| 36 public protocol::VideoStub { | 40 public protocol::VideoStub { |
| 37 public: | 41 public: |
| 38 // Objects passed in are not owned by this class. | 42 // Objects passed in are not owned by this class. |
| 39 ChromotingClient(const ClientConfig& config, | 43 ChromotingClient(const ClientConfig& config, |
| 40 ClientContext* context, | 44 ClientContext* context, |
| 41 protocol::ConnectionToHost* connection, | 45 protocol::ConnectionToHost* connection, |
| 42 ChromotingView* view, | 46 ChromotingView* view, |
| 43 RectangleUpdateDecoder* rectangle_decoder, | 47 RectangleUpdateDecoder* rectangle_decoder, |
| 44 const base::Closure& client_done); | 48 const base::Closure& client_done); |
| 45 virtual ~ChromotingClient(); | 49 virtual ~ChromotingClient(); |
| 46 | 50 |
| 47 void Start(scoped_refptr<XmppProxy> xmpp_proxy); | 51 void Start(scoped_refptr<XmppProxy> xmpp_proxy, |
| 52 scoped_ptr<protocol::TransportFactory> transport_factory); |
| 48 void Stop(const base::Closure& shutdown_task); | 53 void Stop(const base::Closure& shutdown_task); |
| 49 void ClientDone(); | 54 void ClientDone(); |
| 50 | 55 |
| 51 // Return the stats recorded by this client. | 56 // Return the stats recorded by this client. |
| 52 ChromotingStats* GetStats(); | 57 ChromotingStats* GetStats(); |
| 53 | 58 |
| 54 // ClipboardStub implementation. | 59 // ClipboardStub implementation. |
| 55 virtual void InjectClipboardEvent(const protocol::ClipboardEvent& event) | 60 virtual void InjectClipboardEvent(const protocol::ClipboardEvent& event) |
| 56 OVERRIDE; | 61 OVERRIDE; |
| 57 | 62 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 int64 last_sequence_number_; | 122 int64 last_sequence_number_; |
| 118 | 123 |
| 119 ScopedThreadProxy thread_proxy_; | 124 ScopedThreadProxy thread_proxy_; |
| 120 | 125 |
| 121 DISALLOW_COPY_AND_ASSIGN(ChromotingClient); | 126 DISALLOW_COPY_AND_ASSIGN(ChromotingClient); |
| 122 }; | 127 }; |
| 123 | 128 |
| 124 } // namespace remoting | 129 } // namespace remoting |
| 125 | 130 |
| 126 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_H_ | 131 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_H_ |
| OLD | NEW |