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 #include "remoting/protocol/authentication_method.h" | |
6 #include "remoting/test/remote_host_info.h" | 5 #include "remoting/test/remote_host_info.h" |
7 | 6 |
8 #include "base/logging.h" | 7 #include "base/logging.h" |
9 | 8 |
10 namespace { | 9 namespace { |
11 const char kAppRemotingCapabilities[] = | 10 const char kAppRemotingCapabilities[] = |
12 "rateLimitResizeRequests desktopShape sendInitialResolution googleDrive"; | 11 "rateLimitResizeRequests desktopShape sendInitialResolution googleDrive"; |
13 const char kFakeHostPublicKey[] = "FAKE_HOST_PUBLIC_KEY"; | 12 const char kFakeHostPublicKey[] = "FAKE_HOST_PUBLIC_KEY"; |
14 } | 13 } |
15 | 14 |
16 namespace remoting { | 15 namespace remoting { |
17 namespace test { | 16 namespace test { |
18 | 17 |
19 RemoteHostInfo::RemoteHostInfo() | 18 RemoteHostInfo::RemoteHostInfo() |
20 : remote_host_status(kRemoteHostStatusUnknown) { | 19 : remote_host_status(kRemoteHostStatusUnknown) {} |
21 } | |
22 | 20 |
23 RemoteHostInfo::~RemoteHostInfo() { | 21 RemoteHostInfo::~RemoteHostInfo() {} |
24 } | |
25 | 22 |
26 bool RemoteHostInfo::IsReadyForConnection() const { | 23 bool RemoteHostInfo::IsReadyForConnection() const { |
27 return remote_host_status == kRemoteHostStatusReady; | 24 return remote_host_status == kRemoteHostStatusReady; |
28 } | 25 } |
29 | 26 |
30 void RemoteHostInfo::SetRemoteHostStatusFromString( | 27 void RemoteHostInfo::SetRemoteHostStatusFromString( |
31 const std::string& status_string) { | 28 const std::string& status_string) { |
32 if (status_string == "done") { | 29 if (status_string == "done") { |
33 remote_host_status = kRemoteHostStatusReady; | 30 remote_host_status = kRemoteHostStatusReady; |
34 } else if (status_string == "pending") { | 31 } else if (status_string == "pending") { |
(...skipping 10 matching lines...) Expand all Loading... |
45 ConnectionSetupInfo connection_setup_info; | 42 ConnectionSetupInfo connection_setup_info; |
46 connection_setup_info.access_token = access_token; | 43 connection_setup_info.access_token = access_token; |
47 connection_setup_info.authorization_code = authorization_code; | 44 connection_setup_info.authorization_code = authorization_code; |
48 connection_setup_info.capabilities = kAppRemotingCapabilities; | 45 connection_setup_info.capabilities = kAppRemotingCapabilities; |
49 connection_setup_info.host_id = host_id; | 46 connection_setup_info.host_id = host_id; |
50 connection_setup_info.host_jid = host_jid; | 47 connection_setup_info.host_jid = host_jid; |
51 connection_setup_info.public_key = kFakeHostPublicKey; | 48 connection_setup_info.public_key = kFakeHostPublicKey; |
52 connection_setup_info.shared_secret = shared_secret; | 49 connection_setup_info.shared_secret = shared_secret; |
53 connection_setup_info.user_name = user_name; | 50 connection_setup_info.user_name = user_name; |
54 | 51 |
55 connection_setup_info.auth_methods.push_back( | |
56 protocol::AuthenticationMethod::THIRD_PARTY); | |
57 | |
58 return connection_setup_info; | 52 return connection_setup_info; |
59 } | 53 } |
60 | 54 |
61 } // namespace test | 55 } // namespace test |
62 } // namespace remoting | 56 } // namespace remoting |
OLD | NEW |