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

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

Issue 275543005: Use GUID instead of ServicePath in networkingPrivate API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 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 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 "base/values.h" 8 #include "base/values.h"
9 #include "chromeos/network/network_event_log.h" 9 #include "chromeos/network/network_event_log.h"
10 #include "chromeos/network/network_profile_handler.h" 10 #include "chromeos/network/network_profile_handler.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 result += ","; 245 result += ",";
246 result += dns_servers_[i]; 246 result += dns_servers_[i];
247 } 247 }
248 return result; 248 return result;
249 } 249 }
250 250
251 std::string NetworkState::GetNetmask() const { 251 std::string NetworkState::GetNetmask() const {
252 return network_util::PrefixLengthToNetmask(prefix_length_); 252 return network_util::PrefixLengthToNetmask(prefix_length_);
253 } 253 }
254 254
255 void NetworkState::SetGuid(const std::string& guid) {
256 guid_ = guid;
257 }
258
255 bool NetworkState::UpdateName(const base::DictionaryValue& properties) { 259 bool NetworkState::UpdateName(const base::DictionaryValue& properties) {
256 std::string updated_name = 260 std::string updated_name =
257 shill_property_util::GetNameFromProperties(path(), properties); 261 shill_property_util::GetNameFromProperties(path(), properties);
258 if (updated_name != name()) { 262 if (updated_name != name()) {
259 set_name(updated_name); 263 set_name(updated_name);
260 return true; 264 return true;
261 } 265 }
262 return false; 266 return false;
263 } 267 }
264 268
(...skipping 11 matching lines...) Expand all
276 connection_state == shill::kStateCarrier); 280 connection_state == shill::kStateCarrier);
277 } 281 }
278 282
279 // static 283 // static
280 bool NetworkState::ErrorIsValid(const std::string& error) { 284 bool NetworkState::ErrorIsValid(const std::string& error) {
281 // Shill uses "Unknown" to indicate an unset or cleared error state. 285 // Shill uses "Unknown" to indicate an unset or cleared error state.
282 return !error.empty() && error != kErrorUnknown; 286 return !error.empty() && error != kErrorUnknown;
283 } 287 }
284 288
285 } // namespace chromeos 289 } // 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