| 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_REMOTE_HOST_INFO_H_ | 5 #ifndef REMOTING_TEST_REMOTE_HOST_INFO_H_ |
| 6 #define REMOTING_TEST_REMOTE_HOST_INFO_H_ | 6 #define REMOTING_TEST_REMOTE_HOST_INFO_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "remoting/test/connection_setup_info.h" |
| 11 |
| 10 namespace remoting { | 12 namespace remoting { |
| 11 namespace test { | 13 namespace test { |
| 12 | 14 |
| 13 enum RemoteHostStatus { | 15 enum RemoteHostStatus { |
| 14 kRemoteHostStatusReady, | 16 kRemoteHostStatusReady, |
| 15 kRemoteHostStatusPending, | 17 kRemoteHostStatusPending, |
| 16 kRemoteHostStatusUnknown | 18 kRemoteHostStatusUnknown |
| 17 }; | 19 }; |
| 18 | 20 |
| 19 // Holds the information needed to establish a connection with a remote host. | 21 // Holds the information needed to establish a connection with a remote host. |
| 20 struct RemoteHostInfo { | 22 struct RemoteHostInfo { |
| 21 RemoteHostInfo(); | 23 RemoteHostInfo(); |
| 22 ~RemoteHostInfo(); | 24 ~RemoteHostInfo(); |
| 23 | 25 |
| 24 // Returns true if the remote host is ready to accept connections. | 26 // Returns true if the remote host is ready to accept connections. |
| 25 bool IsReadyForConnection() const; | 27 bool IsReadyForConnection() const; |
| 26 | 28 |
| 27 // Sets the |remote_host_status| based on the caller supplied string. | 29 // Sets the |remote_host_status| based on the caller supplied string. |
| 28 void SetRemoteHostStatusFromString(const std::string& status_string); | 30 void SetRemoteHostStatusFromString(const std::string& status_string); |
| 29 | 31 |
| 32 // Generates connection information to establish a chromoting connection. |
| 33 ConnectionSetupInfo GenerateConnectionSetupInfo( |
| 34 const std::string& access_token, |
| 35 const std::string& user_name) const; |
| 36 |
| 30 // Data used to establish a connection with a remote host. | 37 // Data used to establish a connection with a remote host. |
| 31 RemoteHostStatus remote_host_status; | 38 RemoteHostStatus remote_host_status; |
| 32 std::string application_id; | 39 std::string application_id; |
| 33 std::string host_id; | 40 std::string host_id; |
| 34 std::string host_jid; | 41 std::string host_jid; |
| 35 std::string authorization_code; | 42 std::string authorization_code; |
| 36 std::string shared_secret; | 43 std::string shared_secret; |
| 37 }; | 44 }; |
| 38 | 45 |
| 39 } // namespace test | 46 } // namespace test |
| 40 } // namespace remoting | 47 } // namespace remoting |
| 41 | 48 |
| 42 #endif // REMOTING_TEST_REMOTE_HOST_INFO_H_ | 49 #endif // REMOTING_TEST_REMOTE_HOST_INFO_H_ |
| OLD | NEW |