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

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..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,

Powered by Google App Engine
This is Rietveld 408576698