| 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/i18n/icu_encoding_detection.h" | 7 #include "base/i18n/icu_encoding_detection.h" |
| 8 #include "base/i18n/icu_string_conversions.h" | 8 #include "base/i18n/icu_string_conversions.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 dictionary->SetStringWithoutPathExpansion(flimflam::kGuidProperty, guid_); | 205 dictionary->SetStringWithoutPathExpansion(flimflam::kGuidProperty, guid_); |
| 206 dictionary->SetStringWithoutPathExpansion(flimflam::kProfileProperty, | 206 dictionary->SetStringWithoutPathExpansion(flimflam::kProfileProperty, |
| 207 profile_path_); | 207 profile_path_); |
| 208 dictionary->SetBooleanWithoutPathExpansion( | 208 dictionary->SetBooleanWithoutPathExpansion( |
| 209 shill::kActivateOverNonCellularNetworkProperty, | 209 shill::kActivateOverNonCellularNetworkProperty, |
| 210 activate_over_non_cellular_networks_); | 210 activate_over_non_cellular_networks_); |
| 211 dictionary->SetBooleanWithoutPathExpansion(shill::kOutOfCreditsProperty, | 211 dictionary->SetBooleanWithoutPathExpansion(shill::kOutOfCreditsProperty, |
| 212 cellular_out_of_credits_); | 212 cellular_out_of_credits_); |
| 213 } | 213 } |
| 214 | 214 |
| 215 void NetworkState::GetConfigProperties( |
| 216 base::DictionaryValue* dictionary) const { |
| 217 dictionary->SetStringWithoutPathExpansion(flimflam::kNameProperty, name()); |
| 218 dictionary->SetStringWithoutPathExpansion(flimflam::kTypeProperty, type()); |
| 219 dictionary->SetStringWithoutPathExpansion(flimflam::kSecurityProperty, |
| 220 security_); |
| 221 dictionary->SetStringWithoutPathExpansion(flimflam::kGuidProperty, guid()); |
| 222 } |
| 223 |
| 215 bool NetworkState::IsConnectedState() const { | 224 bool NetworkState::IsConnectedState() const { |
| 216 return StateIsConnected(connection_state_); | 225 return StateIsConnected(connection_state_); |
| 217 } | 226 } |
| 218 | 227 |
| 219 bool NetworkState::IsConnectingState() const { | 228 bool NetworkState::IsConnectingState() const { |
| 220 return StateIsConnecting(connection_state_); | 229 return StateIsConnecting(connection_state_); |
| 221 } | 230 } |
| 222 | 231 |
| 223 bool NetworkState::HasAuthenticationError() const { | 232 bool NetworkState::HasAuthenticationError() const { |
| 224 return (error_ == flimflam::kErrorBadPassphrase || | 233 return (error_ == flimflam::kErrorBadPassphrase || |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 connection_state == flimflam::kStateConfiguration || | 310 connection_state == flimflam::kStateConfiguration || |
| 302 connection_state == flimflam::kStateCarrier); | 311 connection_state == flimflam::kStateCarrier); |
| 303 } | 312 } |
| 304 | 313 |
| 305 // static | 314 // static |
| 306 std::string NetworkState::IPConfigProperty(const char* key) { | 315 std::string NetworkState::IPConfigProperty(const char* key) { |
| 307 return base::StringPrintf("%s.%s", shill::kIPConfigProperty, key); | 316 return base::StringPrintf("%s.%s", shill::kIPConfigProperty, key); |
| 308 } | 317 } |
| 309 | 318 |
| 310 } // namespace chromeos | 319 } // namespace chromeos |
| OLD | NEW |