| 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/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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 last_error_ = error_; | 92 last_error_ = error_; |
| 93 else | 93 else |
| 94 error_.clear(); | 94 error_.clear(); |
| 95 return true; | 95 return true; |
| 96 } else if (key == shill::kActivationTypeProperty) { | 96 } else if (key == shill::kActivationTypeProperty) { |
| 97 return GetStringValue(key, value, &activation_type_); | 97 return GetStringValue(key, value, &activation_type_); |
| 98 } else if (key == shill::kActivationStateProperty) { | 98 } else if (key == shill::kActivationStateProperty) { |
| 99 return GetStringValue(key, value, &activation_state_); | 99 return GetStringValue(key, value, &activation_state_); |
| 100 } else if (key == shill::kRoamingStateProperty) { | 100 } else if (key == shill::kRoamingStateProperty) { |
| 101 return GetStringValue(key, value, &roaming_); | 101 return GetStringValue(key, value, &roaming_); |
| 102 } else if (key == shill::kPaymentPortalProperty) { |
| 103 const base::DictionaryValue* olp; |
| 104 if (!value.GetAsDictionary(&olp)) |
| 105 return false; |
| 106 return olp->GetStringWithoutPathExpansion(shill::kPaymentPortalURL, |
| 107 &payment_url_); |
| 102 } else if (key == shill::kSecurityProperty) { | 108 } else if (key == shill::kSecurityProperty) { |
| 103 return GetStringValue(key, value, &security_); | 109 return GetStringValue(key, value, &security_); |
| 104 } else if (key == shill::kEapMethodProperty) { | 110 } else if (key == shill::kEapMethodProperty) { |
| 105 return GetStringValue(key, value, &eap_method_); | 111 return GetStringValue(key, value, &eap_method_); |
| 106 } else if (key == shill::kNetworkTechnologyProperty) { | 112 } else if (key == shill::kNetworkTechnologyProperty) { |
| 107 return GetStringValue(key, value, &network_technology_); | 113 return GetStringValue(key, value, &network_technology_); |
| 108 } else if (key == shill::kDeviceProperty) { | 114 } else if (key == shill::kDeviceProperty) { |
| 109 return GetStringValue(key, value, &device_path_); | 115 return GetStringValue(key, value, &device_path_); |
| 110 } else if (key == shill::kGuidProperty) { | 116 } else if (key == shill::kGuidProperty) { |
| 111 return GetStringValue(key, value, &guid_); | 117 return GetStringValue(key, value, &guid_); |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 connection_state == shill::kStateCarrier); | 343 connection_state == shill::kStateCarrier); |
| 338 } | 344 } |
| 339 | 345 |
| 340 // static | 346 // static |
| 341 bool NetworkState::ErrorIsValid(const std::string& error) { | 347 bool NetworkState::ErrorIsValid(const std::string& error) { |
| 342 // Shill uses "Unknown" to indicate an unset or cleared error state. | 348 // Shill uses "Unknown" to indicate an unset or cleared error state. |
| 343 return !error.empty() && error != kErrorUnknown; | 349 return !error.empty() && error != kErrorUnknown; |
| 344 } | 350 } |
| 345 | 351 |
| 346 } // namespace chromeos | 352 } // namespace chromeos |
| OLD | NEW |