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 | |
joedow
2015/07/17 23:26:29
remove extra newline
tonychun
2015/07/20 14:29:17
Done.
| |
6 #include "base/strings/string_split.h" | |
joedow
2015/07/17 23:26:30
Is the string split header still needed? It seems
tonychun
2015/07/20 14:29:17
Done.
| |
7 #include "remoting/protocol/authentication_method.h" | |
5 #include "remoting/test/host_info.h" | 8 #include "remoting/test/host_info.h" |
6 | 9 |
7 #include "base/logging.h" | 10 #include "base/logging.h" |
8 | 11 |
9 namespace remoting { | 12 namespace remoting { |
10 namespace test { | 13 namespace test { |
11 | 14 |
12 HostInfo::HostInfo() { | 15 HostInfo::HostInfo() { |
13 } | 16 } |
14 | 17 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
63 status == kHostStatusOnline) { | 66 status == kHostStatusOnline) { |
64 LOG(ERROR) << host_name << " is online but is missing a jabberId"; | 67 LOG(ERROR) << host_name << " is online but is missing a jabberId"; |
65 return false; | 68 return false; |
66 } | 69 } |
67 | 70 |
68 host_info.GetString("hostOfflineReason", &offline_reason); | 71 host_info.GetString("hostOfflineReason", &offline_reason); |
69 | 72 |
70 return true; | 73 return true; |
71 } | 74 } |
72 | 75 |
76 bool HostInfo::IsReadyForConnection() const { | |
77 return !host_jid.empty() && status == kHostStatusOnline; | |
78 } | |
79 | |
80 ConnectionSetupInfo HostInfo::GenerateConnectionSetupInfo( | |
81 const std::string& access_token, | |
82 const std::string& user_name, | |
83 const std::string& pin) const { | |
84 ConnectionSetupInfo connection_setup_info; | |
85 connection_setup_info.access_token = access_token; | |
86 connection_setup_info.host_id = host_id; | |
87 connection_setup_info.host_jid = host_jid; | |
88 connection_setup_info.host_name = host_name; | |
89 connection_setup_info.pin = pin; | |
90 connection_setup_info.public_key = public_key; | |
91 connection_setup_info.user_name = user_name; | |
joedow
2015/07/17 23:26:29
Can you some newlines here, one after line 84 woul
tonychun
2015/07/20 14:29:17
Done.
| |
92 connection_setup_info.auth_methods.push_back( | |
93 protocol::AuthenticationMethod::Spake2Pair()); | |
94 connection_setup_info.auth_methods.push_back( | |
95 protocol::AuthenticationMethod::Spake2( | |
96 protocol::AuthenticationMethod::HashFunction::NONE)); | |
97 connection_setup_info.auth_methods.push_back( | |
98 protocol::AuthenticationMethod::Spake2( | |
99 protocol::AuthenticationMethod::HashFunction::HMAC_SHA256)); | |
100 connection_setup_info.auth_methods.push_back( | |
101 protocol::AuthenticationMethod::ThirdParty()); | |
102 | |
103 return connection_setup_info; | |
104 } | |
105 | |
73 } // namespace test | 106 } // namespace test |
74 } // namespace remoting | 107 } // namespace remoting |
OLD | NEW |