Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: remoting/client/ios/facade/host_info.cc

Issue 2809793002: Build Chrome Remote Desktop for iOS in Chromium trybots. (Closed)
Patch Set: Second fixup from CL 2809023003. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/BUILD.gn ('k') | remoting/client/ios/facade/host_list_fetcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/client/ios/facade/host_info.h" 5 #include "remoting/client/ios/facade/host_info.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace remoting { 9 namespace remoting {
10 10
11 HostInfo::HostInfo() {} 11 HostInfo::HostInfo() {}
12 12
13 HostInfo::HostInfo(const HostInfo& other) = default; 13 HostInfo::HostInfo(const HostInfo& other) = default;
14 14
15 HostInfo::~HostInfo() {} 15 HostInfo::~HostInfo() {}
16 16
17 bool HostInfo::ParseHostInfo(const base::DictionaryValue& host_info) { 17 bool HostInfo::ParseHostInfo(const base::DictionaryValue& host_info) {
18 const base::ListValue* list_value = nullptr; 18 const base::ListValue* list_value = nullptr;
19 19
20 // Add TokenUrlPatterns to HostInfo. 20 // Add TokenUrlPatterns to HostInfo.
21 if (host_info.GetList("tokenUrlPatterns", &list_value)) { 21 if (host_info.GetList("tokenUrlPatterns", &list_value)) {
22 if (!list_value->empty()) { 22 if (!list_value->empty()) {
23 for (const auto& item : *list_value) { 23 for (const auto& item : *list_value) {
24 std::string token_url_pattern; 24 std::string token_url_pattern;
25 if (!item->GetAsString(&token_url_pattern)) { 25 if (!item.GetAsString(&token_url_pattern)) {
26 return false; 26 return false;
27 } 27 }
28 token_url_patterns.push_back(token_url_pattern); 28 token_url_patterns.push_back(token_url_pattern);
29 } 29 }
30 } 30 }
31 } 31 }
32 32
33 std::string response_status; 33 std::string response_status;
34 host_info.GetString("status", &response_status); 34 host_info.GetString("status", &response_status);
35 if (response_status == "ONLINE") { 35 if (response_status == "ONLINE") {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 host_info.GetString("hostOfflineReason", &offline_reason); 67 host_info.GetString("hostOfflineReason", &offline_reason);
68 68
69 return true; 69 return true;
70 } 70 }
71 71
72 bool HostInfo::IsReadyForConnection() const { 72 bool HostInfo::IsReadyForConnection() const {
73 return !host_jid.empty() && status == kHostStatusOnline; 73 return !host_jid.empty() && status == kHostStatusOnline;
74 } 74 }
75 75
76 } // namespace remoting 76 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/BUILD.gn ('k') | remoting/client/ios/facade/host_list_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698