Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef REMOTING_TEST_TEST_CHROMOTING_CLIENT_H_ | 5 #ifndef REMOTING_TEST_TEST_CHROMOTING_CLIENT_H_ |
| 6 #define REMOTING_TEST_TEST_CHROMOTING_CLIENT_H_ | 6 #define REMOTING_TEST_TEST_CHROMOTING_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
| 13 #include "remoting/client/chromoting_client.h" | 13 #include "remoting/client/chromoting_client.h" |
| 14 #include "remoting/client/client_user_interface.h" | 14 #include "remoting/client/client_user_interface.h" |
| 15 #include "remoting/protocol/clipboard_filter.h" | 15 #include "remoting/protocol/clipboard_filter.h" |
| 16 #include "remoting/protocol/cursor_shape_stub.h" | 16 #include "remoting/protocol/cursor_shape_stub.h" |
| 17 #include "remoting/test/remote_connection_observer.h" | 17 #include "remoting/test/remote_connection_observer.h" |
| 18 #include "remoting/test/remote_host_info.h" | 18 #include "remoting/test/remote_host_info.h" |
|
joedow
2015/07/20 16:39:53
You can remove remote_host_info from here since yo
tonychun
2015/07/20 18:13:01
Done.
| |
| 19 | 19 |
| 20 namespace remoting { | 20 namespace remoting { |
| 21 | 21 |
| 22 class ClientContext; | 22 class ClientContext; |
| 23 class XmppSignalStrategy; | 23 class XmppSignalStrategy; |
| 24 class VideoRenderer; | 24 class VideoRenderer; |
| 25 | 25 |
| 26 namespace protocol { | 26 namespace protocol { |
| 27 class ClipboardStub; | 27 class ClipboardStub; |
| 28 class HostStub; | 28 class HostStub; |
| 29 class InputStub; | 29 class InputStub; |
| 30 } | 30 } // namespace protocol |
| 31 | 31 |
| 32 namespace test { | 32 namespace test { |
| 33 | 33 |
| 34 struct ConnectionSetupInfo; | |
| 35 | |
| 34 // Manages a chromoting connection to a remote host. Destroying a | 36 // Manages a chromoting connection to a remote host. Destroying a |
| 35 // TestChromotingClient object with an active connection will close it. | 37 // TestChromotingClient object with an active connection will close it. |
| 36 // Must be used from a thread running an IO message loop. | 38 // Must be used from a thread running an IO message loop. |
| 37 // RemoteConnectionObserver objects must not destroy this class within a | 39 // RemoteConnectionObserver objects must not destroy this class within a |
| 38 // callback. | 40 // callback. |
| 39 // A VideoRenderer can be passed in to customize the connection. | 41 // A VideoRenderer can be passed in to customize the connection. |
| 40 class TestChromotingClient : public ClientUserInterface, | 42 class TestChromotingClient : public ClientUserInterface, |
| 41 public protocol::ClipboardStub, | 43 public protocol::ClipboardStub, |
| 42 public protocol::CursorShapeStub { | 44 public protocol::CursorShapeStub { |
| 43 public: | 45 public: |
| 44 TestChromotingClient(); | 46 TestChromotingClient(); |
| 45 explicit TestChromotingClient(scoped_ptr<VideoRenderer> video_renderer); | 47 explicit TestChromotingClient(scoped_ptr<VideoRenderer> video_renderer); |
| 46 ~TestChromotingClient() override; | 48 ~TestChromotingClient() override; |
| 47 | 49 |
| 48 // Starts a chromoting connection with the specified remote host. | 50 // Starts a Chromoting connection using the specified connection setup info. |
| 49 void StartConnection(const std::string& user_name, | 51 void StartConnection(const ConnectionSetupInfo& connection_setup_info); |
| 50 const std::string& access_token, | |
| 51 const RemoteHostInfo& remote_host_info); | |
| 52 | 52 |
| 53 // Ends the current remote connection and updates the connection state. | 53 // Ends the current remote connection and updates the connection state. |
| 54 void EndConnection(); | 54 void EndConnection(); |
| 55 | 55 |
| 56 // Stubs used to send messages to the remote host. | 56 // Stubs used to send messages to the remote host. |
| 57 protocol::ClipboardStub* clipboard_forwarder() { | 57 protocol::ClipboardStub* clipboard_forwarder() { |
| 58 return chromoting_client_->clipboard_forwarder(); | 58 return chromoting_client_->clipboard_forwarder(); |
| 59 } | 59 } |
| 60 protocol::HostStub* host_stub() { return chromoting_client_->host_stub(); } | 60 protocol::HostStub* host_stub() { return chromoting_client_->host_stub(); } |
| 61 protocol::InputStub* input_stub() { return chromoting_client_->input_stub(); } | 61 protocol::InputStub* input_stub() { return chromoting_client_->input_stub(); } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 // Used to establish an XMPP connection with the google talk service. | 118 // Used to establish an XMPP connection with the google talk service. |
| 119 scoped_ptr<XmppSignalStrategy> signal_strategy_; | 119 scoped_ptr<XmppSignalStrategy> signal_strategy_; |
| 120 | 120 |
| 121 DISALLOW_COPY_AND_ASSIGN(TestChromotingClient); | 121 DISALLOW_COPY_AND_ASSIGN(TestChromotingClient); |
| 122 }; | 122 }; |
| 123 | 123 |
| 124 } // namespace test | 124 } // namespace test |
| 125 } // namespace remoting | 125 } // namespace remoting |
| 126 | 126 |
| 127 #endif // REMOTING_TEST_TEST_CHROMOTING_CLIENT_H_ | 127 #endif // REMOTING_TEST_TEST_CHROMOTING_CLIENT_H_ |
| OLD | NEW |