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

Side by Side Diff: chromeos/network/network_state.cc

Issue 330833003: Rely on Service.Visible instead of Manager.Services (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix stubs for tests Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « chromeos/network/network_state.h ('k') | chromeos/network/network_state_handler.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chromeos/network/network_state.h" 5 #include "chromeos/network/network_state.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "chromeos/network/network_event_log.h" 8 #include "chromeos/network/network_event_log.h"
9 #include "chromeos/network/network_profile_handler.h" 9 #include "chromeos/network/network_profile_handler.h"
10 #include "chromeos/network/network_type_pattern.h" 10 #include "chromeos/network/network_type_pattern.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 bool NetworkState::PropertyChanged(const std::string& key, 76 bool NetworkState::PropertyChanged(const std::string& key,
77 const base::Value& value) { 77 const base::Value& value) {
78 // Keep care that these properties are the same as in |GetProperties|. 78 // Keep care that these properties are the same as in |GetProperties|.
79 if (ManagedStatePropertyChanged(key, value)) 79 if (ManagedStatePropertyChanged(key, value))
80 return true; 80 return true;
81 if (key == shill::kSignalStrengthProperty) { 81 if (key == shill::kSignalStrengthProperty) {
82 return GetIntegerValue(key, value, &signal_strength_); 82 return GetIntegerValue(key, value, &signal_strength_);
83 } else if (key == shill::kStateProperty) { 83 } else if (key == shill::kStateProperty) {
84 return GetStringValue(key, value, &connection_state_); 84 return GetStringValue(key, value, &connection_state_);
85 } else if (key == shill::kVisibleProperty) {
86 return GetBooleanValue(key, value, &visible_);
85 } else if (key == shill::kConnectableProperty) { 87 } else if (key == shill::kConnectableProperty) {
86 return GetBooleanValue(key, value, &connectable_); 88 return GetBooleanValue(key, value, &connectable_);
87 } else if (key == shill::kErrorProperty) { 89 } else if (key == shill::kErrorProperty) {
88 if (!GetStringValue(key, value, &error_)) 90 if (!GetStringValue(key, value, &error_))
89 return false; 91 return false;
90 if (ErrorIsValid(error_)) 92 if (ErrorIsValid(error_))
91 last_error_ = error_; 93 last_error_ = error_;
92 else 94 else
93 error_.clear(); 95 error_.clear();
94 return true; 96 return true;
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 connection_state == shill::kStateCarrier); 347 connection_state == shill::kStateCarrier);
346 } 348 }
347 349
348 // static 350 // static
349 bool NetworkState::ErrorIsValid(const std::string& error) { 351 bool NetworkState::ErrorIsValid(const std::string& error) {
350 // Shill uses "Unknown" to indicate an unset or cleared error state. 352 // Shill uses "Unknown" to indicate an unset or cleared error state.
351 return !error.empty() && error != kErrorUnknown; 353 return !error.empty() && error != kErrorUnknown;
352 } 354 }
353 355
354 } // namespace chromeos 356 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/network_state.h ('k') | chromeos/network/network_state_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698