Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6149)

Unified Diff: chromeos/network/network_state.cc

Issue 694533007: Add 'setProperties' to InternetOptionsHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromeos/network/network_state.cc
diff --git a/chromeos/network/network_state.cc b/chromeos/network/network_state.cc
index 915a688de3cdaa9c51afe49888bfdb6e5243b8db..b6a42d2d128f99eb9a7d714ad59abda5f3af3f6b 100644
--- a/chromeos/network/network_state.cc
+++ b/chromeos/network/network_state.cc
@@ -174,31 +174,43 @@ bool NetworkState::InitialPropertiesReceived(
}
void NetworkState::GetStateProperties(base::DictionaryValue* dictionary) const {
- ManagedState::GetStateProperties(dictionary);
+ GetConfigurationStateProperties(dictionary);
pneubeck (no reviews) 2014/11/11 16:09:31 maybe add a comment that the remainder of this fun
- // Properties shared by all types.
- dictionary->SetStringWithoutPathExpansion(shill::kGuidProperty, guid());
- dictionary->SetStringWithoutPathExpansion(shill::kSecurityProperty,
- security());
+ if (!visible())
+ return;
- if (visible()) {
- if (!error().empty())
- dictionary->SetStringWithoutPathExpansion(shill::kErrorProperty, error());
- dictionary->SetStringWithoutPathExpansion(shill::kStateProperty,
- connection_state());
- }
+ dictionary->SetStringWithoutPathExpansion(shill::kStateProperty,
+ connection_state());
+ if (!error().empty())
+ dictionary->SetStringWithoutPathExpansion(shill::kErrorProperty, error());
// Wireless properties
- if (!NetworkTypePattern::Wireless().MatchesType(type()))
- return;
-
- if (visible()) {
+ 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,
+ roaming());
+ dictionary->SetBooleanWithoutPathExpansion(shill::kOutOfCreditsProperty,
+ cellular_out_of_credits());
+ }
+}
+
+void NetworkState::GetConfigurationStateProperties(
+ base::DictionaryValue* dictionary) const {
+ // Properties shared by all types.
+ ManagedState::GetStateProperties(dictionary);
pneubeck (no reviews) 2014/11/11 16:09:31 this seems not intuitive. The function description
stevenjb 2014/11/12 01:23:29 Separated out GetNetworkStateProperties and GetVis
+ dictionary->SetStringWithoutPathExpansion(shill::kGuidProperty, guid());
+ dictionary->SetStringWithoutPathExpansion(shill::kSecurityProperty,
+ security());
+
// Wifi properties
if (NetworkTypePattern::WiFi().MatchesType(type())) {
dictionary->SetStringWithoutPathExpansion(shill::kEapMethodProperty,
@@ -210,12 +222,6 @@ void NetworkState::GetStateProperties(base::DictionaryValue* dictionary) const {
dictionary->SetStringWithoutPathExpansion(
shill::kNetworkTechnologyProperty,
network_technology());
- dictionary->SetStringWithoutPathExpansion(shill::kActivationStateProperty,
- activation_state());
- dictionary->SetStringWithoutPathExpansion(shill::kRoamingStateProperty,
- roaming());
- dictionary->SetBooleanWithoutPathExpansion(shill::kOutOfCreditsProperty,
- cellular_out_of_credits());
}
}

Powered by Google App Engine
This is Rietveld 408576698