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

Unified Diff: chromeos/network/network_state.cc

Issue 17091006: Add additional cellular-related properties to Network|DeviceState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address stevenjb comments Created 7 years, 6 months 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
« no previous file with comments | « chromeos/network/network_state.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_state.cc
diff --git a/chromeos/network/network_state.cc b/chromeos/network/network_state.cc
index 5a8914cec2a8582c6abcafd69cdeaa4689dfd16a..4fa78804ddbc56533eb980ef9af851d9488171c8 100644
--- a/chromeos/network/network_state.cc
+++ b/chromeos/network/network_state.cc
@@ -158,6 +158,20 @@ bool NetworkState::PropertyChanged(const std::string& key,
return GetBooleanValue(key, value, &activate_over_non_cellular_networks_);
} else if (key == shill::kOutOfCreditsProperty) {
return GetBooleanValue(key, value, &cellular_out_of_credits_);
+ } else if (key == flimflam::kUsageURLProperty) {
+ return GetStringValue(key, value, &usage_url_);
+ } else if (key == flimflam::kPaymentPortalProperty) {
+ const DictionaryValue& dict = static_cast<const DictionaryValue&>(value);
+ if (!dict.GetStringWithoutPathExpansion(flimflam::kPaymentPortalURL,
+ &payment_url_))
+ return false;
+ if (!dict.GetStringWithoutPathExpansion(flimflam::kPaymentPortalMethod,
+ &post_method_))
+ return false;
+ if (!dict.GetStringWithoutPathExpansion(flimflam::kPaymentPortalPostData,
+ &post_data_))
+ return false;
+ return true;
} else if (key == flimflam::kWifiHexSsid) {
return GetStringValue(key, value, &hex_ssid_);
} else if (key == flimflam::kCountryProperty) {
@@ -230,6 +244,18 @@ void NetworkState::GetProperties(base::DictionaryValue* dictionary) const {
activate_over_non_cellular_networks_);
dictionary->SetBooleanWithoutPathExpansion(shill::kOutOfCreditsProperty,
cellular_out_of_credits_);
+ base::DictionaryValue* payment_portal_properties = new DictionaryValue;
+ payment_portal_properties->SetStringWithoutPathExpansion(
+ flimflam::kPaymentPortalURL,
+ payment_url_);
+ payment_portal_properties->SetStringWithoutPathExpansion(
+ flimflam::kPaymentPortalMethod,
+ post_method_);
+ payment_portal_properties->SetStringWithoutPathExpansion(
+ flimflam::kPaymentPortalPostData,
+ post_data_);
+ dictionary->SetWithoutPathExpansion(flimflam::kPaymentPortalProperty,
+ payment_portal_properties);
}
void NetworkState::GetConfigProperties(
« no previous file with comments | « chromeos/network/network_state.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698