Index: chromeos/network/network_state.cc |
diff --git a/chromeos/network/network_state.cc b/chromeos/network/network_state.cc |
index 915a688de3cdaa9c51afe49888bfdb6e5243b8db..bad360d709b86e0ecc6db7fccbae8a65f21f553e 100644 |
--- a/chromeos/network/network_state.cc |
+++ b/chromeos/network/network_state.cc |
@@ -175,30 +175,23 @@ bool NetworkState::InitialPropertiesReceived( |
void NetworkState::GetStateProperties(base::DictionaryValue* dictionary) const { |
ManagedState::GetStateProperties(dictionary); |
+ GetNetworkStateProperties(dictionary); |
+ if (visible()) |
+ GetVisibleStateProperties(dictionary); |
+} |
+ |
+void NetworkState::GetConfigurationStateProperties( |
+ base::DictionaryValue* dictionary) const { |
+ ManagedState::GetStateProperties(dictionary); |
+ GetNetworkStateProperties(dictionary); |
+} |
- // Properties shared by all types. |
+void NetworkState::GetNetworkStateProperties( |
+ base::DictionaryValue* dictionary) const { |
dictionary->SetStringWithoutPathExpansion(shill::kGuidProperty, guid()); |
dictionary->SetStringWithoutPathExpansion(shill::kSecurityProperty, |
security()); |
- if (visible()) { |
- if (!error().empty()) |
- dictionary->SetStringWithoutPathExpansion(shill::kErrorProperty, error()); |
- dictionary->SetStringWithoutPathExpansion(shill::kStateProperty, |
- connection_state()); |
- } |
- |
- // Wireless properties |
- if (!NetworkTypePattern::Wireless().MatchesType(type())) |
- return; |
- |
- if (visible()) { |
- dictionary->SetBooleanWithoutPathExpansion(shill::kConnectableProperty, |
- connectable()); |
- dictionary->SetIntegerWithoutPathExpansion(shill::kSignalStrengthProperty, |
- signal_strength()); |
- } |
- |
// Wifi properties |
if (NetworkTypePattern::WiFi().MatchesType(type())) { |
dictionary->SetStringWithoutPathExpansion(shill::kEapMethodProperty, |
@@ -210,6 +203,26 @@ void NetworkState::GetStateProperties(base::DictionaryValue* dictionary) const { |
dictionary->SetStringWithoutPathExpansion( |
shill::kNetworkTechnologyProperty, |
network_technology()); |
+ } |
+} |
+ |
+void NetworkState::GetVisibleStateProperties( |
+ base::DictionaryValue* dictionary) const { |
+ dictionary->SetStringWithoutPathExpansion(shill::kStateProperty, |
+ connection_state()); |
+ if (!error().empty()) |
+ dictionary->SetStringWithoutPathExpansion(shill::kErrorProperty, error()); |
+ |
+ // Wireless properties |
+ if (NetworkTypePattern::Wireless().MatchesType(type())) { |
+ dictionary->SetBooleanWithoutPathExpansion(shill::kConnectableProperty, |
+ connectable()); |
+ dictionary->SetIntegerWithoutPathExpansion(shill::kSignalStrengthProperty, |
+ signal_strength()); |
+ } |
+ |
+ // Mobile properties |
+ if (NetworkTypePattern::Mobile().MatchesType(type())) { |
dictionary->SetStringWithoutPathExpansion(shill::kActivationStateProperty, |
activation_state()); |
dictionary->SetStringWithoutPathExpansion(shill::kRoamingStateProperty, |