diff options
author | stevenjb <stevenjb@chromium.org> | 2015-04-09 12:50:07 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-09 19:50:46 +0000 |
commit | b7d10c9a1d93e53fa8e706d62db8a4bb68b2381d (patch) | |
tree | 51619ec2120eb48ffd0af5a85ed1b8a63df91eef /chromeos | |
parent | fe53e50cf943cf2fa352e41e5343ea1a1d331570 (diff) | |
download | chromium_src-b7d10c9a1d93e53fa8e706d62db8a4bb68b2381d.zip chromium_src-b7d10c9a1d93e53fa8e706d62db8a4bb68b2381d.tar.gz chromium_src-b7d10c9a1d93e53fa8e706d62db8a4bb68b2381d.tar.bz2 |
Replace Settings cellular carrier and activation with networkingPrivate
This uses the recent networkingPrivate changes to support setting
Cellular.Carrier in setProperties and adding startActivate in
internet_details.js.
BUG=430115
Review URL: https://codereview.chromium.org/1046593003
Cr-Commit-Position: refs/heads/master@{#324490}
Diffstat (limited to 'chromeos')
6 files changed, 34 insertions, 0 deletions
diff --git a/chromeos/network/onc/onc_signature.cc b/chromeos/network/onc/onc_signature.cc index 378bf2e..551fa34 100644 --- a/chromeos/network/onc/onc_signature.cc +++ b/chromeos/network/onc/onc_signature.cc @@ -231,6 +231,12 @@ const OncFieldSignature wimax_with_state_fields[] = { {::onc::wimax::kSignalStrength, &kIntegerSignature}, {NULL}}; +const OncFieldSignature cellular_payment_portal_fields[] = { + {::onc::cellular_payment_portal::kMethod, &kStringSignature}, + {::onc::cellular_payment_portal::kPostData, &kStringSignature}, + {::onc::cellular_payment_portal::kUrl, &kStringSignature}, + {NULL}}; + const OncFieldSignature cellular_provider_fields[] = { {::onc::cellular_provider::kCode, &kStringSignature}, {::onc::cellular_provider::kCountry, &kStringSignature}, @@ -288,6 +294,7 @@ const OncFieldSignature cellular_with_state_fields[] = { {::onc::cellular::kMIN, &kStringSignature}, {::onc::cellular::kModelID, &kStringSignature}, {::onc::cellular::kNetworkTechnology, &kStringSignature}, + {::onc::cellular::kPaymentPortal, &kCellularPaymentPortalSignature}, {::onc::cellular::kPRLVersion, &kIntegerSignature}, {::onc::cellular::kRoamingState, &kStringSignature}, {::onc::cellular::kServingOperator, &kCellularProviderSignature}, @@ -472,6 +479,10 @@ const OncValueSignature kCellularWithStateSignature = { cellular_with_state_fields, NULL, &kCellularSignature}; +const OncValueSignature kCellularPaymentPortalSignature = { + base::Value::TYPE_DICTIONARY, + cellular_payment_portal_fields, + NULL}; const OncValueSignature kCellularProviderSignature = { base::Value::TYPE_DICTIONARY, cellular_provider_fields, diff --git a/chromeos/network/onc/onc_signature.h b/chromeos/network/onc/onc_signature.h index d0c9e50..9b01d3a 100644 --- a/chromeos/network/onc/onc_signature.h +++ b/chromeos/network/onc/onc_signature.h @@ -69,6 +69,7 @@ CHROMEOS_EXPORT extern const OncValueSignature kWiFiWithStateSignature; CHROMEOS_EXPORT extern const OncValueSignature kWiMAXWithStateSignature; CHROMEOS_EXPORT extern const OncValueSignature kCellularSignature; CHROMEOS_EXPORT extern const OncValueSignature kCellularWithStateSignature; +CHROMEOS_EXPORT extern const OncValueSignature kCellularPaymentPortalSignature; CHROMEOS_EXPORT extern const OncValueSignature kCellularProviderSignature; CHROMEOS_EXPORT extern const OncValueSignature kCellularApnSignature; CHROMEOS_EXPORT extern const OncValueSignature kCellularFoundNetworkSignature; diff --git a/chromeos/network/onc/onc_translation_tables.cc b/chromeos/network/onc/onc_translation_tables.cc index 564b9dc..285a7e1 100644 --- a/chromeos/network/onc/onc_translation_tables.cc +++ b/chromeos/network/onc/onc_translation_tables.cc @@ -149,6 +149,12 @@ const FieldTranslationEntry cellular_found_network_fields[] = { {::onc::cellular_found_network::kLongName, shill::kLongNameProperty}, {NULL}}; +const FieldTranslationEntry cellular_payment_portal_fields[] = { + {::onc::cellular_payment_portal::kMethod, shill::kPaymentPortalMethod}, + {::onc::cellular_payment_portal::kPostData, shill::kPaymentPortalPostData}, + {::onc::cellular_payment_portal::kUrl, shill::kPaymentPortalURL}, + {NULL}}; + const FieldTranslationEntry cellular_provider_fields[] = { {::onc::cellular_provider::kCode, shill::kOperatorCodeKey}, {::onc::cellular_provider::kCountry, shill::kOperatorCountryKey}, @@ -172,6 +178,8 @@ const FieldTranslationEntry cellular_fields[] = { // { ::onc::cellular::kNetworkTechnology, // shill::kNetworkTechnologyProperty}, // This field is converted during translation, see onc_translator_*. + // { ::onc::cellular::kPaymentPortal, shill::kPaymentPortal}, + // This field is converted during translation, see onc_translator_*. // { ::onc::cellular::kRoamingState, shill::kRoamingStateProperty}, {::onc::cellular::kSignalStrength, shill::kSignalStrengthProperty}, {NULL}}; @@ -237,6 +245,7 @@ const OncValueTranslationEntry onc_value_translation_table[] = { {&kWiMAXWithStateSignature, wimax_fields}, {&kCellularApnSignature, cellular_apn_fields}, {&kCellularFoundNetworkSignature, cellular_found_network_fields}, + {&kCellularPaymentPortalSignature, cellular_payment_portal_fields}, {&kCellularProviderSignature, cellular_provider_fields}, {&kSIMLockStatusSignature, sim_lock_status_fields}, {&kCellularSignature, cellular_fields}, diff --git a/chromeos/network/onc/onc_translator_shill_to_onc.cc b/chromeos/network/onc/onc_translator_shill_to_onc.cc index a97d51e..d918156 100644 --- a/chromeos/network/onc/onc_translator_shill_to_onc.cc +++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc @@ -370,6 +370,11 @@ void ShillToONCTranslator::TranslateCellularWithState() { shill::kCellularLastGoodApnProperty, &dictionary)) { TranslateAndAddNestedObject(::onc::cellular::kLastGoodAPN, *dictionary); } + if (shill_dictionary_->GetDictionaryWithoutPathExpansion( + shill::kPaymentPortalProperty, &dictionary)) { + TranslateAndAddNestedObject(::onc::cellular::kPaymentPortal, *dictionary); + } + const base::DictionaryValue* device_dictionary = NULL; bool requires_roaming = false; shill_dictionary_->GetDictionaryWithoutPathExpansion(shill::kDeviceProperty, diff --git a/chromeos/test/data/network/shill_cellular_with_state.json b/chromeos/test/data/network/shill_cellular_with_state.json index 149eeac..a330e70 100644 --- a/chromeos/test/data/network/shill_cellular_with_state.json +++ b/chromeos/test/data/network/shill_cellular_with_state.json @@ -5,6 +5,10 @@ "Cellular.ActivationState": "activated", "Cellular.ActivationType": "OTASP", "Cellular.NetworkTechnology": "LTE Advanced", + "Cellular.Olp": { + "method": "GET", + "url": "http://test.com/payment" + }, "Cellular.RoamingState": "home", "Cellular.ServingOperator": { "code": "test-code", diff --git a/chromeos/test/data/network/translation_of_shill_cellular_with_state.onc b/chromeos/test/data/network/translation_of_shill_cellular_with_state.onc index da0b0d87..d90db84 100644 --- a/chromeos/test/data/network/translation_of_shill_cellular_with_state.onc +++ b/chromeos/test/data/network/translation_of_shill_cellular_with_state.onc @@ -12,6 +12,10 @@ "Name": "cellular_provider" }, "NetworkTechnology": "LTEAdvanced", + "PaymentPortal": { + "Method": "GET", + "Url": "http://test.com/payment" + }, "RoamingState": "Home", "ServingOperator": { "Code": "test-code", |