| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 error_.clear(); | 95 error_.clear(); |
| 96 return true; | 96 return true; |
| 97 } else if (key == shill::kActivationStateProperty) { | 97 } else if (key == shill::kActivationStateProperty) { |
| 98 return GetStringValue(key, value, &activation_state_); | 98 return GetStringValue(key, value, &activation_state_); |
| 99 } else if (key == shill::kRoamingStateProperty) { | 99 } else if (key == shill::kRoamingStateProperty) { |
| 100 return GetStringValue(key, value, &roaming_); | 100 return GetStringValue(key, value, &roaming_); |
| 101 } else if (key == shill::kSecurityProperty) { | 101 } else if (key == shill::kSecurityProperty) { |
| 102 return GetStringValue(key, value, &security_); | 102 return GetStringValue(key, value, &security_); |
| 103 } else if (key == shill::kEapMethodProperty) { | 103 } else if (key == shill::kEapMethodProperty) { |
| 104 return GetStringValue(key, value, &eap_method_); | 104 return GetStringValue(key, value, &eap_method_); |
| 105 } else if (key == shill::kUIDataProperty) { | |
| 106 scoped_ptr<NetworkUIData> new_ui_data = | |
| 107 shill_property_util::GetUIDataFromValue(value); | |
| 108 if (!new_ui_data) { | |
| 109 NET_LOG_ERROR("Failed to parse " + key, path()); | |
| 110 return false; | |
| 111 } | |
| 112 ui_data_ = *new_ui_data; | |
| 113 return true; | |
| 114 } else if (key == shill::kNetworkTechnologyProperty) { | 105 } else if (key == shill::kNetworkTechnologyProperty) { |
| 115 return GetStringValue(key, value, &network_technology_); | 106 return GetStringValue(key, value, &network_technology_); |
| 116 } else if (key == shill::kDeviceProperty) { | 107 } else if (key == shill::kDeviceProperty) { |
| 117 return GetStringValue(key, value, &device_path_); | 108 return GetStringValue(key, value, &device_path_); |
| 118 } else if (key == shill::kGuidProperty) { | 109 } else if (key == shill::kGuidProperty) { |
| 119 return GetStringValue(key, value, &guid_); | 110 return GetStringValue(key, value, &guid_); |
| 120 } else if (key == shill::kProfileProperty) { | 111 } else if (key == shill::kProfileProperty) { |
| 121 return GetStringValue(key, value, &profile_path_); | 112 return GetStringValue(key, value, &profile_path_); |
| 122 } else if (key == shill::kActivateOverNonCellularNetworkProperty) { | 113 } else if (key == shill::kActivateOverNonCellularNetworkProperty) { |
| 123 return GetBooleanValue(key, value, &activate_over_non_cellular_networks_); | 114 return GetBooleanValue(key, value, &activate_over_non_cellular_networks_); |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 connection_state == shill::kStateCarrier); | 338 connection_state == shill::kStateCarrier); |
| 348 } | 339 } |
| 349 | 340 |
| 350 // static | 341 // static |
| 351 bool NetworkState::ErrorIsValid(const std::string& error) { | 342 bool NetworkState::ErrorIsValid(const std::string& error) { |
| 352 // Shill uses "Unknown" to indicate an unset or cleared error state. | 343 // Shill uses "Unknown" to indicate an unset or cleared error state. |
| 353 return !error.empty() && error != kErrorUnknown; | 344 return !error.empty() && error != kErrorUnknown; |
| 354 } | 345 } |
| 355 | 346 |
| 356 } // namespace chromeos | 347 } // namespace chromeos |
| OLD | NEW |