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_HOST_INFO_H_ | 5 #ifndef REMOTING_TEST_HOST_INFO_H_ |
6 #define REMOTING_TEST_HOST_INFO_H_ | 6 #define REMOTING_TEST_HOST_INFO_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "remoting/test/connection_setup_info.h" | 12 #include "remoting/test/connection_setup_info.h" |
13 | 13 |
14 namespace remoting { | 14 namespace remoting { |
15 namespace test { | 15 namespace test { |
16 | 16 |
17 enum HostStatus { | 17 enum HostStatus { |
18 kHostStatusOnline, | 18 kHostStatusOnline, |
19 kHostStatusOffline | 19 kHostStatusOffline |
20 }; | 20 }; |
21 | 21 |
22 struct HostInfo { | 22 struct HostInfo { |
23 HostInfo(); | 23 HostInfo(); |
| 24 HostInfo(const HostInfo& other); |
24 ~HostInfo(); | 25 ~HostInfo(); |
25 | 26 |
26 // Returns true if |host_info| is valid and initializes HostInfo. | 27 // Returns true if |host_info| is valid and initializes HostInfo. |
27 bool ParseHostInfo(const base::DictionaryValue& host_info); | 28 bool ParseHostInfo(const base::DictionaryValue& host_info); |
28 | 29 |
29 // Returns true if the chromoting host is ready to accept connections. | 30 // Returns true if the chromoting host is ready to accept connections. |
30 bool IsReadyForConnection() const; | 31 bool IsReadyForConnection() const; |
31 | 32 |
32 // Generates connection information to establish a chromoting connection. | 33 // Generates connection information to establish a chromoting connection. |
33 ConnectionSetupInfo GenerateConnectionSetupInfo( | 34 ConnectionSetupInfo GenerateConnectionSetupInfo( |
34 const std::string& access_token, | 35 const std::string& access_token, |
35 const std::string& user_name, | 36 const std::string& user_name, |
36 const std::string& pin) const; | 37 const std::string& pin) const; |
37 | 38 |
38 std::string host_id; | 39 std::string host_id; |
39 std::string host_jid; | 40 std::string host_jid; |
40 std::string host_name; | 41 std::string host_name; |
41 HostStatus status = kHostStatusOffline; | 42 HostStatus status = kHostStatusOffline; |
42 std::string offline_reason; | 43 std::string offline_reason; |
43 std::string public_key; | 44 std::string public_key; |
44 std::vector<std::string> token_url_patterns; | 45 std::vector<std::string> token_url_patterns; |
45 }; | 46 }; |
46 | 47 |
47 } // namespace test | 48 } // namespace test |
48 } // namespace remoting | 49 } // namespace remoting |
49 | 50 |
50 #endif // REMOTING_TEST_HOST_INFO_H_ | 51 #endif // REMOTING_TEST_HOST_INFO_H_ |
OLD | NEW |