| 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 "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chromeos/network/network_event_log.h" | 9 #include "chromeos/network/network_event_log.h" |
| 10 #include "chromeos/network/network_profile_handler.h" | 10 #include "chromeos/network/network_profile_handler.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 return changed; | 139 return changed; |
| 140 } | 140 } |
| 141 | 141 |
| 142 void NetworkState::GetStateProperties(base::DictionaryValue* dictionary) const { | 142 void NetworkState::GetStateProperties(base::DictionaryValue* dictionary) const { |
| 143 ManagedState::GetStateProperties(dictionary); | 143 ManagedState::GetStateProperties(dictionary); |
| 144 | 144 |
| 145 // Properties shared by all types. | 145 // Properties shared by all types. |
| 146 dictionary->SetStringWithoutPathExpansion(shill::kGuidProperty, guid()); | 146 dictionary->SetStringWithoutPathExpansion(shill::kGuidProperty, guid()); |
| 147 dictionary->SetStringWithoutPathExpansion(shill::kStateProperty, | 147 dictionary->SetStringWithoutPathExpansion(shill::kStateProperty, |
| 148 connection_state()); | 148 connection_state()); |
| 149 dictionary->SetBooleanWithoutPathExpansion(shill::kConnectableProperty, |
| 150 connectable()); |
| 149 dictionary->SetStringWithoutPathExpansion(shill::kErrorProperty, error()); | 151 dictionary->SetStringWithoutPathExpansion(shill::kErrorProperty, error()); |
| 150 dictionary->SetStringWithoutPathExpansion(shill::kSecurityProperty, | 152 dictionary->SetStringWithoutPathExpansion(shill::kSecurityProperty, |
| 151 security()); | 153 security()); |
| 152 | 154 |
| 153 if (!NetworkTypePattern::Wireless().MatchesType(type())) | 155 if (!NetworkTypePattern::Wireless().MatchesType(type())) |
| 154 return; | 156 return; |
| 155 | 157 |
| 156 // Wireless properties | 158 // Wireless properties |
| 157 dictionary->SetBooleanWithoutPathExpansion(shill::kConnectableProperty, | 159 dictionary->SetBooleanWithoutPathExpansion(shill::kConnectableProperty, |
| 158 connectable()); | 160 connectable()); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 connection_state == shill::kStateCarrier); | 277 connection_state == shill::kStateCarrier); |
| 276 } | 278 } |
| 277 | 279 |
| 278 // static | 280 // static |
| 279 bool NetworkState::ErrorIsValid(const std::string& error) { | 281 bool NetworkState::ErrorIsValid(const std::string& error) { |
| 280 // Shill uses "Unknown" to indicate an unset or cleared error state. | 282 // Shill uses "Unknown" to indicate an unset or cleared error state. |
| 281 return !error.empty() && error != kErrorUnknown; | 283 return !error.empty() && error != kErrorUnknown; |
| 282 } | 284 } |
| 283 | 285 |
| 284 } // namespace chromeos | 286 } // namespace chromeos |
| OLD | NEW |