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/connection_setup_info.h" | |
Sergey Ulanov
2015/07/16 23:42:10
ConnectionSetupInfo is passed by reference so it c
tonychun
2015/07/17 16:25:49
Done.
| |
17 #include "remoting/test/remote_connection_observer.h" | 18 #include "remoting/test/remote_connection_observer.h" |
18 #include "remoting/test/remote_host_info.h" | 19 #include "remoting/test/remote_host_info.h" |
19 | 20 |
20 namespace remoting { | 21 namespace remoting { |
21 | 22 |
22 class ClientContext; | 23 class ClientContext; |
23 class XmppSignalStrategy; | 24 class XmppSignalStrategy; |
24 class VideoRenderer; | 25 class VideoRenderer; |
25 | 26 |
26 namespace protocol { | 27 namespace protocol { |
27 class ClipboardStub; | 28 class ClipboardStub; |
28 class HostStub; | 29 class HostStub; |
29 class InputStub; | 30 class InputStub; |
30 } | 31 } // namespace protocol |
31 | 32 |
32 namespace test { | 33 namespace test { |
33 | 34 |
34 // Manages a chromoting connection to a remote host. Destroying a | 35 // Manages a chromoting connection to a remote host. Destroying a |
35 // TestChromotingClient object with an active connection will close it. | 36 // TestChromotingClient object with an active connection will close it. |
36 // Must be used from a thread running an IO message loop. | 37 // Must be used from a thread running an IO message loop. |
37 // RemoteConnectionObserver objects must not destroy this class within a | 38 // RemoteConnectionObserver objects must not destroy this class within a |
38 // callback. | 39 // callback. |
39 // A VideoRenderer can be passed in to customize the connection. | 40 // A VideoRenderer can be passed in to customize the connection. |
40 class TestChromotingClient : public ClientUserInterface, | 41 class TestChromotingClient : public ClientUserInterface, |
41 public protocol::ClipboardStub, | 42 public protocol::ClipboardStub, |
42 public protocol::CursorShapeStub { | 43 public protocol::CursorShapeStub { |
43 public: | 44 public: |
44 TestChromotingClient(); | 45 TestChromotingClient(); |
45 explicit TestChromotingClient(scoped_ptr<VideoRenderer> video_renderer); | 46 explicit TestChromotingClient(scoped_ptr<VideoRenderer> video_renderer); |
46 ~TestChromotingClient() override; | 47 ~TestChromotingClient() override; |
47 | 48 |
48 // Starts a chromoting connection with the specified remote host. | 49 // Starts a Chromoting connection using the specified connection setup info. |
49 void StartConnection(const std::string& user_name, | 50 void StartConnection(const ConnectionSetupInfo& connection_setup_info); |
50 const std::string& access_token, | |
51 const RemoteHostInfo& remote_host_info); | |
52 | 51 |
53 // Ends the current remote connection and updates the connection state. | 52 // Ends the current remote connection and updates the connection state. |
54 void EndConnection(); | 53 void EndConnection(); |
55 | 54 |
56 // Stubs used to send messages to the remote host. | 55 // Stubs used to send messages to the remote host. |
57 protocol::ClipboardStub* clipboard_forwarder() { | 56 protocol::ClipboardStub* clipboard_forwarder() { |
58 return chromoting_client_->clipboard_forwarder(); | 57 return chromoting_client_->clipboard_forwarder(); |
59 } | 58 } |
60 protocol::HostStub* host_stub() { return chromoting_client_->host_stub(); } | 59 protocol::HostStub* host_stub() { return chromoting_client_->host_stub(); } |
61 protocol::InputStub* input_stub() { return chromoting_client_->input_stub(); } | 60 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. | 117 // Used to establish an XMPP connection with the google talk service. |
119 scoped_ptr<XmppSignalStrategy> signal_strategy_; | 118 scoped_ptr<XmppSignalStrategy> signal_strategy_; |
120 | 119 |
121 DISALLOW_COPY_AND_ASSIGN(TestChromotingClient); | 120 DISALLOW_COPY_AND_ASSIGN(TestChromotingClient); |
122 }; | 121 }; |
123 | 122 |
124 } // namespace test | 123 } // namespace test |
125 } // namespace remoting | 124 } // namespace remoting |
126 | 125 |
127 #endif // REMOTING_TEST_TEST_CHROMOTING_CLIENT_H_ | 126 #endif // REMOTING_TEST_TEST_CHROMOTING_CLIENT_H_ |
OLD | NEW |