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

Unified Diff: remoting/client/ios/facade/host_info.cc

Issue 2871993003: Moving the iOS directory to be remoting top level. (Closed)
Patch Set: //remoting/ios was the old landing target for the internal iOS application. Fix. Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/ios/facade/host_info.h ('k') | remoting/client/ios/facade/host_list_fetcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/ios/facade/host_info.cc
diff --git a/remoting/client/ios/facade/host_info.cc b/remoting/client/ios/facade/host_info.cc
deleted file mode 100644
index c036e535baf94de810925e461d2cf0ec84aab28a..0000000000000000000000000000000000000000
--- a/remoting/client/ios/facade/host_info.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "remoting/client/ios/facade/host_info.h"
-
-#include "base/logging.h"
-
-namespace remoting {
-
-HostInfo::HostInfo() {}
-
-HostInfo::HostInfo(const HostInfo& other) = default;
-
-HostInfo::~HostInfo() {}
-
-bool HostInfo::ParseHostInfo(const base::DictionaryValue& host_info) {
- const base::ListValue* list_value = nullptr;
-
- // Add TokenUrlPatterns to HostInfo.
- if (host_info.GetList("tokenUrlPatterns", &list_value)) {
- if (!list_value->empty()) {
- for (const auto& item : *list_value) {
- std::string token_url_pattern;
- if (!item.GetAsString(&token_url_pattern)) {
- return false;
- }
- token_url_patterns.push_back(token_url_pattern);
- }
- }
- }
-
- std::string response_status;
- host_info.GetString("status", &response_status);
- if (response_status == "ONLINE") {
- status = kHostStatusOnline;
- } else if (response_status == "OFFLINE") {
- status = kHostStatusOffline;
- } else {
- LOG(ERROR) << "Unknown response status: " << response_status;
- return false;
- }
-
- if (!host_info.GetString("hostId", &host_id)) {
- LOG(ERROR) << "hostId was not found in host_info";
- return false;
- }
-
- if (!host_info.GetString("hostName", &host_name)) {
- LOG(ERROR) << "hostName was not found in host_info";
- return false;
- }
-
- if (!host_info.GetString("publicKey", &public_key)) {
- LOG(ERROR) << "publicKey was not found for " << host_name;
- return false;
- }
-
- // If the host entry was created but the host was never online, then the jid
- // is never set.
- if (!host_info.GetString("jabberId", &host_jid) &&
- status == kHostStatusOnline) {
- LOG(ERROR) << host_name << " is online but is missing a jabberId";
- return false;
- }
-
- host_info.GetString("hostOfflineReason", &offline_reason);
-
- return true;
-}
-
-bool HostInfo::IsReadyForConnection() const {
- return !host_jid.empty() && status == kHostStatusOnline;
-}
-
-} // namespace remoting
« no previous file with comments | « remoting/client/ios/facade/host_info.h ('k') | remoting/client/ios/facade/host_list_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698