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

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

Issue 917053002: Add Source property to networkingPrivate.getState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase with separated test expectations Created 5 years, 10 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 | « chromeos/network/network_configuration_handler.cc ('k') | chromeos/network/network_util.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 (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/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "chromeos/device_event_log.h" 10 #include "chromeos/device_event_log.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 return UpdateName(properties); 195 return UpdateName(properties);
196 } 196 }
197 197
198 void NetworkState::GetStateProperties(base::DictionaryValue* dictionary) const { 198 void NetworkState::GetStateProperties(base::DictionaryValue* dictionary) const {
199 ManagedState::GetStateProperties(dictionary); 199 ManagedState::GetStateProperties(dictionary);
200 200
201 // Properties shared by all types. 201 // Properties shared by all types.
202 dictionary->SetStringWithoutPathExpansion(shill::kGuidProperty, guid()); 202 dictionary->SetStringWithoutPathExpansion(shill::kGuidProperty, guid());
203 dictionary->SetStringWithoutPathExpansion(shill::kSecurityClassProperty, 203 dictionary->SetStringWithoutPathExpansion(shill::kSecurityClassProperty,
204 security_class()); 204 security_class());
205 dictionary->SetStringWithoutPathExpansion(shill::kProfileProperty,
206 profile_path());
205 207
206 if (visible()) { 208 if (visible()) {
207 if (!error().empty()) 209 if (!error().empty())
208 dictionary->SetStringWithoutPathExpansion(shill::kErrorProperty, error()); 210 dictionary->SetStringWithoutPathExpansion(shill::kErrorProperty, error());
209 dictionary->SetStringWithoutPathExpansion(shill::kStateProperty, 211 dictionary->SetStringWithoutPathExpansion(shill::kStateProperty,
210 connection_state()); 212 connection_state());
211 } 213 }
212 214
213 // Wireless properties 215 // Wireless properties
214 if (!NetworkTypePattern::Wireless().MatchesType(type())) 216 if (!NetworkTypePattern::Wireless().MatchesType(type()))
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 return IsCaptivePortalState(shill_properties, false /* log */); 377 return IsCaptivePortalState(shill_properties, false /* log */);
376 } 378 }
377 379
378 // static 380 // static
379 bool NetworkState::ErrorIsValid(const std::string& error) { 381 bool NetworkState::ErrorIsValid(const std::string& error) {
380 // Shill uses "Unknown" to indicate an unset or cleared error state. 382 // Shill uses "Unknown" to indicate an unset or cleared error state.
381 return !error.empty() && error != kErrorUnknown; 383 return !error.empty() && error != kErrorUnknown;
382 } 384 }
383 385
384 } // namespace chromeos 386 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/network_configuration_handler.cc ('k') | chromeos/network/network_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698