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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 dictionary->SetStringWithoutPathExpansion(flimflam::kGuidProperty, guid_); | 225 dictionary->SetStringWithoutPathExpansion(flimflam::kGuidProperty, guid_); |
226 dictionary->SetStringWithoutPathExpansion(flimflam::kProfileProperty, | 226 dictionary->SetStringWithoutPathExpansion(flimflam::kProfileProperty, |
227 profile_path_); | 227 profile_path_); |
228 dictionary->SetBooleanWithoutPathExpansion( | 228 dictionary->SetBooleanWithoutPathExpansion( |
229 shill::kActivateOverNonCellularNetworkProperty, | 229 shill::kActivateOverNonCellularNetworkProperty, |
230 activate_over_non_cellular_networks_); | 230 activate_over_non_cellular_networks_); |
231 dictionary->SetBooleanWithoutPathExpansion(shill::kOutOfCreditsProperty, | 231 dictionary->SetBooleanWithoutPathExpansion(shill::kOutOfCreditsProperty, |
232 cellular_out_of_credits_); | 232 cellular_out_of_credits_); |
233 } | 233 } |
234 | 234 |
| 235 void NetworkState::GetConfigProperties( |
| 236 base::DictionaryValue* dictionary) const { |
| 237 dictionary->SetStringWithoutPathExpansion(flimflam::kNameProperty, name()); |
| 238 dictionary->SetStringWithoutPathExpansion(flimflam::kTypeProperty, type()); |
| 239 dictionary->SetStringWithoutPathExpansion(flimflam::kSecurityProperty, |
| 240 security()); |
| 241 dictionary->SetStringWithoutPathExpansion(flimflam::kGuidProperty, guid()); |
| 242 } |
| 243 |
235 bool NetworkState::IsConnectedState() const { | 244 bool NetworkState::IsConnectedState() const { |
236 return StateIsConnected(connection_state_); | 245 return StateIsConnected(connection_state_); |
237 } | 246 } |
238 | 247 |
239 bool NetworkState::IsConnectingState() const { | 248 bool NetworkState::IsConnectingState() const { |
240 return StateIsConnecting(connection_state_); | 249 return StateIsConnecting(connection_state_); |
241 } | 250 } |
242 | 251 |
243 bool NetworkState::HasAuthenticationError() const { | 252 bool NetworkState::HasAuthenticationError() const { |
244 return (error_ == flimflam::kErrorBadPassphrase || | 253 return (error_ == flimflam::kErrorBadPassphrase || |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 connection_state == flimflam::kStateConfiguration || | 330 connection_state == flimflam::kStateConfiguration || |
322 connection_state == flimflam::kStateCarrier); | 331 connection_state == flimflam::kStateCarrier); |
323 } | 332 } |
324 | 333 |
325 // static | 334 // static |
326 std::string NetworkState::IPConfigProperty(const char* key) { | 335 std::string NetworkState::IPConfigProperty(const char* key) { |
327 return base::StringPrintf("%s.%s", shill::kIPConfigProperty, key); | 336 return base::StringPrintf("%s.%s", shill::kIPConfigProperty, key); |
328 } | 337 } |
329 | 338 |
330 } // namespace chromeos | 339 } // namespace chromeos |
OLD | NEW |