| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 return false; | 156 return false; |
| 157 } | 157 } |
| 158 // Ensure that the network has a valid name. | 158 // Ensure that the network has a valid name. |
| 159 changed |= UpdateName(properties); | 159 changed |= UpdateName(properties); |
| 160 | 160 |
| 161 // Set the has_ca_cert_nss_ property. | 161 // Set the has_ca_cert_nss_ property. |
| 162 bool had_ca_cert_nss = has_ca_cert_nss_; | 162 bool had_ca_cert_nss = has_ca_cert_nss_; |
| 163 has_ca_cert_nss_ = IsCaCertNssSet(properties); | 163 has_ca_cert_nss_ = IsCaCertNssSet(properties); |
| 164 changed |= had_ca_cert_nss != has_ca_cert_nss_; | 164 changed |= had_ca_cert_nss != has_ca_cert_nss_; |
| 165 | 165 |
| 166 // By convention, all visible WiFi networks have a SignalStrength > 0. | 166 // By convention, all visible WiFi and WiMAX networks have a |
| 167 if (visible() && type() == shill::kTypeWifi) { | 167 // SignalStrength > 0. |
| 168 if (signal_strength_ <= 0) | 168 if ((type() == shill::kTypeWifi || type() == shill::kTypeWimax) && |
| 169 visible() && signal_strength_ <= 0) { |
| 169 signal_strength_ = 1; | 170 signal_strength_ = 1; |
| 170 } | 171 } |
| 171 | 172 |
| 172 return changed; | 173 return changed; |
| 173 } | 174 } |
| 174 | 175 |
| 175 void NetworkState::GetStateProperties(base::DictionaryValue* dictionary) const { | 176 void NetworkState::GetStateProperties(base::DictionaryValue* dictionary) const { |
| 176 ManagedState::GetStateProperties(dictionary); | 177 ManagedState::GetStateProperties(dictionary); |
| 177 | 178 |
| 178 // Properties shared by all types. | 179 // Properties shared by all types. |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 connection_state == shill::kStateCarrier); | 344 connection_state == shill::kStateCarrier); |
| 344 } | 345 } |
| 345 | 346 |
| 346 // static | 347 // static |
| 347 bool NetworkState::ErrorIsValid(const std::string& error) { | 348 bool NetworkState::ErrorIsValid(const std::string& error) { |
| 348 // Shill uses "Unknown" to indicate an unset or cleared error state. | 349 // Shill uses "Unknown" to indicate an unset or cleared error state. |
| 349 return !error.empty() && error != kErrorUnknown; | 350 return !error.empty() && error != kErrorUnknown; |
| 350 } | 351 } |
| 351 | 352 |
| 352 } // namespace chromeos | 353 } // namespace chromeos |
| OLD | NEW |