| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |