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

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

Issue 260083007: Replace chrome://network implementation with networkConfig API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Feedback 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
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 return changed; 139 return changed;
140 } 140 }
141 141
142 void NetworkState::GetStateProperties(base::DictionaryValue* dictionary) const { 142 void NetworkState::GetStateProperties(base::DictionaryValue* dictionary) const {
143 ManagedState::GetStateProperties(dictionary); 143 ManagedState::GetStateProperties(dictionary);
144 144
145 // Properties shared by all types. 145 // Properties shared by all types.
146 dictionary->SetStringWithoutPathExpansion(shill::kGuidProperty, guid()); 146 dictionary->SetStringWithoutPathExpansion(shill::kGuidProperty, guid());
147 dictionary->SetStringWithoutPathExpansion(shill::kStateProperty, 147 dictionary->SetStringWithoutPathExpansion(shill::kStateProperty,
148 connection_state()); 148 connection_state());
149 dictionary->SetBooleanWithoutPathExpansion(shill::kConnectableProperty,
150 connectable());
149 dictionary->SetStringWithoutPathExpansion(shill::kErrorProperty, error()); 151 dictionary->SetStringWithoutPathExpansion(shill::kErrorProperty, error());
150 dictionary->SetStringWithoutPathExpansion(shill::kSecurityProperty, 152 dictionary->SetStringWithoutPathExpansion(shill::kSecurityProperty,
151 security()); 153 security());
152 154
153 if (!NetworkTypePattern::Wireless().MatchesType(type())) 155 if (!NetworkTypePattern::Wireless().MatchesType(type()))
154 return; 156 return;
155 157
156 // Wireless properties 158 // Wireless properties
157 dictionary->SetBooleanWithoutPathExpansion(shill::kConnectableProperty, 159 dictionary->SetBooleanWithoutPathExpansion(shill::kConnectableProperty,
158 connectable()); 160 connectable());
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 connection_state == shill::kStateCarrier); 277 connection_state == shill::kStateCarrier);
276 } 278 }
277 279
278 // static 280 // static
279 bool NetworkState::ErrorIsValid(const std::string& error) { 281 bool NetworkState::ErrorIsValid(const std::string& error) {
280 // Shill uses "Unknown" to indicate an unset or cleared error state. 282 // Shill uses "Unknown" to indicate an unset or cleared error state.
281 return !error.empty() && error != kErrorUnknown; 283 return !error.empty() && error != kErrorUnknown;
282 } 284 }
283 285
284 } // namespace chromeos 286 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698