diff options
-rw-r--r-- | chrome/browser/resources/options/chromeos/internet_detail.js | 96 | ||||
-rw-r--r-- | chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc | 116 | ||||
-rw-r--r-- | chrome/browser/ui/webui/options/chromeos/internet_options_handler.h | 6 | ||||
-rw-r--r-- | chromeos/network/onc/onc_signature.cc | 11 | ||||
-rw-r--r-- | chromeos/network/onc/onc_signature.h | 1 | ||||
-rw-r--r-- | chromeos/network/onc/onc_translation_tables.cc | 9 | ||||
-rw-r--r-- | chromeos/network/onc/onc_translator_shill_to_onc.cc | 5 | ||||
-rw-r--r-- | chromeos/test/data/network/shill_cellular_with_state.json | 4 | ||||
-rw-r--r-- | chromeos/test/data/network/translation_of_shill_cellular_with_state.onc | 4 | ||||
-rw-r--r-- | components/onc/docs/onc_spec.html | 38 | ||||
-rw-r--r-- | components/onc/onc_constants.cc | 11 | ||||
-rw-r--r-- | components/onc/onc_constants.h | 7 |
12 files changed, 166 insertions, 142 deletions
diff --git a/chrome/browser/resources/options/chromeos/internet_detail.js b/chrome/browser/resources/options/chromeos/internet_detail.js index 340fbb2..1b49bc6 100644 --- a/chrome/browser/resources/options/chromeos/internet_detail.js +++ b/chrome/browser/resources/options/chromeos/internet_detail.js @@ -18,6 +18,8 @@ cr.define('options.internet', function() { /** @const */ var GoogleNameServers = ['8.8.4.4', '8.8.8.8']; /** @const */ var CarrierGenericUMTS = 'Generic UMTS'; + /** @const */ var CarrierSprint = 'Sprint'; + /** @const */ var CarrierVerizon = 'Verizon Wireless'; /** * Helper function to set hidden attribute for elements matching a selector. @@ -169,6 +171,35 @@ cr.define('options.internet', function() { return prefixLength; } + // Returns true if we should show the 'View Account' button for |onc|. + // TODO(stevenjb): We should query the Mobile Config API for whether or not to + // show the 'View Account' button once it is integrated with Settings. + function shouldShowViewAccountButton(onc) { + var activationState = onc.getActiveValue('Cellular.ActivationState'); + if (activationState != 'Activating' && activationState != 'Activated') + return false; + + // If no online payment URL was provided by Shill, only show 'View Account' + // for Verizon Wireless. + if (!onc.getActiveValue('Cellular.PaymentPortal.Url') && + onc.getActiveValue('Cellular.Carrier') != CarrierVerizon) { + return false; + } + + // 'View Account' should only be shown for connected networks, or + // disconnected LTE networks with a valid MDN. + var connectionState = onc.getActiveValue('ConnectionState'); + if (connectionState != 'Connected') { + var technology = onc.getActiveValue('Cellular.NetworkTechnology'); + if (technology != 'LTE' && technology != 'LTEAdvanced') + return false; + if (!onc.getActiveValue('Cellular.MDN')) + return false; + } + + return true; + } + ///////////////////////////////////////////////////////////////////////////// // DetailsInternetPage class: @@ -208,7 +239,7 @@ cr.define('options.internet', function() { }, /** - * Auto-activates the network details dialog if network information + * Automatically shows the network details dialog if network information * is included in the URL. */ showNetworkDetails_: function() { @@ -699,14 +730,15 @@ cr.define('options.internet', function() { $('details-internet-disconnect').hidden = false; } + var showConfigure = false; var connectable = onc.getActiveValue('Connectable'); - if (connectState != 'Connected' && - (!connectable || onc.getWiFiSecurity() != 'None' || - (this.type_ == 'WiMAX' || this.type_ == 'VPN'))) { - $('details-internet-configure').hidden = false; - } else { - $('details-internet-configure').hidden = true; + if (this.type_ == 'WiMAX' || this.type_ == 'VPN') { + showConfigure = true; + } else if (this.type_ == 'WiFi') { + showConfigure = (connectState != 'Connected' && + (!connectable || onc.getWiFiSecurity() != 'None')); } + $('details-internet-configure').hidden = !showConfigure; }, /** @@ -736,10 +768,10 @@ cr.define('options.internet', function() { $('sim-card-lock-enabled').checked = lockEnabled; $('change-pin').hidden = !lockEnabled; } - showViewAccount = onc.getActiveValue('showViewAccountButton'); + showViewAccount = shouldShowViewAccountButton(onc); var activationState = onc.getActiveValue('Cellular.ActivationState'); - showActivate = activationState == 'NotActivated' || - activationState == 'PartiallyActivated'; + showActivate = (activationState == 'NotActivated' || + activationState == 'PartiallyActivated'); } $('view-account-details').hidden = !showViewAccount; @@ -760,7 +792,6 @@ cr.define('options.internet', function() { $('network-details-title').textContent = this.networkTitle_ || onc.getTranslatedValue('Name'); - var connectionState = onc.getActiveValue('ConnectionState'); var connectionStateString = onc.getTranslatedValue('ConnectionState'); $('network-details-subtitle-status').textContent = connectionStateString; @@ -1044,6 +1075,8 @@ cr.define('options.internet', function() { * Shows a spinner while the carrier is changed. */ DetailsInternetPage.showCarrierChangeSpinner = function(visible) { + if (!DetailsInternetPage.getInstance().visible) + return; $('switch-carrier-spinner').hidden = !visible; // Disable any buttons that allow us to operate on cellular networks. DetailsInternetPage.changeCellularButtonsState(visible); @@ -1056,7 +1089,37 @@ cr.define('options.internet', function() { var carrierSelector = $('select-carrier'); var carrier = carrierSelector[carrierSelector.selectedIndex].textContent; DetailsInternetPage.showCarrierChangeSpinner(true); - chrome.send('setCarrier', [carrier]); + var guid = DetailsInternetPage.getInstance().onc_.guid(); + var oncData = new OncData({}); + oncData.setProperty('Cellular.Carrier', carrier); + chrome.networkingPrivate.setProperties(guid, oncData.getData(), function() { + // Start activation or show the activation UI after changing carriers. + DetailsInternetPage.activateCellular(guid); + }); + }; + + /** + * If the network is not already activated, starts the activation process or + * shows the activation UI. Otherwise does nothing. + */ + DetailsInternetPage.activateCellular = function(guid) { + chrome.networkingPrivate.getProperties(guid, function(properties) { + var oncData = new OncData(properties); + if (oncData.getActiveValue('Cellular.ActivationState') == 'Activated') { + DetailsInternetPage.showCarrierChangeSpinner(false); + return; + } + var carrier = oncData.getActiveValue('Cellular.Carrier'); + if (carrier == CarrierSprint) { + // Sprint is directly ativated, call startActivate(). + chrome.networkingPrivate.startActivate(guid, '', function() { + DetailsInternetPage.showCarrierChangeSpinner(false); + }); + } else { + DetailsInternetPage.showCarrierChangeSpinner(false); + chrome.send('showMorePlanInfo', [guid]); + } + }); }; /** @@ -1125,10 +1188,6 @@ cr.define('options.internet', function() { } }; - DetailsInternetPage.updateCarrier = function() { - DetailsInternetPage.showCarrierChangeSpinner(false); - }; - DetailsInternetPage.loginFromDetails = function() { var detailsPage = DetailsInternetPage.getInstance(); if (detailsPage.type_ == 'WiFi') @@ -1158,9 +1217,8 @@ cr.define('options.internet', function() { DetailsInternetPage.activateFromDetails = function() { var detailsPage = DetailsInternetPage.getInstance(); - if (detailsPage.type_ == 'Cellular') { - chrome.send('activateNetwork', [detailsPage.onc_.guid()]); - } + if (detailsPage.type_ == 'Cellular') + DetailsInternetPage.activateCellular(detailsPage.onc_.guid()); PageManager.closeOverlay(); }; diff --git a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc index 3097621..8868fc7 100644 --- a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc +++ b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc @@ -86,12 +86,8 @@ const char kRefreshNetworkDataFunction[] = "options.network.NetworkList.refreshNetworkData"; const char kUpdateConnectionDataFunction[] = "options.internet.DetailsInternetPage.updateConnectionData"; -const char kUpdateCarrierFunction[] = - "options.internet.DetailsInternetPage.updateCarrier"; -// Setter methods called from JS that still need to be converted to match -// networkingPrivate methods. -const char kSetCarrierMessage[] = "setCarrier"; +// JS methods to show additional UI. const char kShowMorePlanInfoMessage[] = "showMorePlanInfo"; const char kSimOperationMessage[] = "simOperation"; @@ -106,7 +102,6 @@ const char kSetNetworkGuidMessage[] = "setNetworkGuid"; const char kAddVPNConnectionMessage[] = "addVPNConnection"; const char kAddNonVPNConnectionMessage[] = "addNonVPNConnection"; const char kConfigureNetworkMessage[] = "configureNetwork"; -const char kActivateNetworkMessage[] = "activateNetwork"; const char kLoadVPNProviders[] = "loadVPNProviders"; @@ -132,9 +127,6 @@ const char kTagWimaxEnabled[] = "wimaxEnabled"; const char kTagWiredList[] = "wiredList"; const char kTagWirelessList[] = "wirelessList"; -// Pseudo-ONC chrome specific properties appended to the ONC dictionary. -const char kTagShowViewAccountButton[] = "showViewAccountButton"; - void ShillError(const std::string& function, const std::string& error_name, scoped_ptr<base::DictionaryValue> error_data) { @@ -175,48 +167,6 @@ base::DictionaryValue* BuildNetworkDictionary( return network_info.release(); } -bool ShowViewAccountButton(const NetworkState* cellular) { - if (cellular->activation_state() != shill::kActivationStateActivating && - cellular->activation_state() != shill::kActivationStateActivated) - return false; - - const DeviceState* device = - NetworkHandler::Get()->network_state_handler()->GetDeviceState( - cellular->device_path()); - - // If no online payment URL was provided by shill, Check to see if the - // MobileConfig carrier indicates that "View Account" should be shown. - if (cellular->payment_url().empty()) { - if (!device || !MobileConfig::GetInstance()->IsReady()) - return false; - const MobileConfig::Carrier* carrier = - MobileConfig::GetInstance()->GetCarrier(device->home_provider_id()); - if (!carrier || !carrier->show_portal_button()) - return false; - } - - if (!cellular->IsConnectedState()) { - // Disconnected LTE networks should show the button if we are online and - // the device's MDN is set. This is to enable users to update their plan - // if they are out of credits. - if (!NetworkHandler::Get()->network_state_handler()->DefaultNetwork()) - return false; - const std::string& technology = cellular->network_technology(); - if (technology != shill::kNetworkTechnologyLte && - technology != shill::kNetworkTechnologyLteAdvanced) - return false; - std::string mdn; - if (device) { - device->properties().GetStringWithoutPathExpansion(shill::kMdnProperty, - &mdn); - } - if (mdn.empty()) - return false; - } - - return true; -} - bool IsVPNProvider(const extensions::Extension* extension) { return extension->permissions_data()->HasAPIPermission( extensions::APIPermission::kVpnProvider); @@ -296,15 +246,9 @@ void InternetOptionsHandler::RegisterMessages() { web_ui()->RegisterMessageCallback(kConfigureNetworkMessage, base::Bind(&InternetOptionsHandler::ConfigureNetwork, base::Unretained(this))); - web_ui()->RegisterMessageCallback(kActivateNetworkMessage, - base::Bind(&InternetOptionsHandler::ActivateNetwork, - base::Unretained(this))); web_ui()->RegisterMessageCallback(kShowMorePlanInfoMessage, base::Bind(&InternetOptionsHandler::ShowMorePlanInfoCallback, base::Unretained(this))); - web_ui()->RegisterMessageCallback(kSetCarrierMessage, - base::Bind(&InternetOptionsHandler::SetCarrierCallback, - base::Unretained(this))); web_ui()->RegisterMessageCallback(kSimOperationMessage, base::Bind(&InternetOptionsHandler::SimOperationCallback, base::Unretained(this))); @@ -357,41 +301,6 @@ void InternetOptionsHandler::ShowMorePlanInfoCallback( ui::NetworkConnect::Get()->ShowMobileSetup(service_path); } -void InternetOptionsHandler::CarrierStatusCallback() { - NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); - const DeviceState* device = - handler->GetDeviceStateByType(NetworkTypePattern::Cellular()); - if (device && (device->carrier() == shill::kCarrierSprint)) { - const NetworkState* network = - handler->FirstNetworkByType(NetworkTypePattern::Cellular()); - if (network && network->guid() == details_guid_) { - ui::NetworkConnect::Get()->ActivateCellular(network->path()); - UpdateConnectionData(network->path()); - } - } - UpdateCarrier(); -} - -void InternetOptionsHandler::SetCarrierCallback(const base::ListValue* args) { - std::string carrier; - if (args->GetSize() != 1 || !args->GetString(1, &carrier)) { - NOTREACHED(); - return; - } - const DeviceState* device = NetworkHandler::Get()->network_state_handler()-> - GetDeviceStateByType(NetworkTypePattern::Cellular()); - if (!device) { - LOG(WARNING) << "SetCarrierCallback with no cellular device."; - return; - } - NetworkHandler::Get()->network_device_handler()->SetCarrier( - device->path(), - carrier, - base::Bind(&InternetOptionsHandler::CarrierStatusCallback, - weak_factory_.GetWeakPtr()), - base::Bind(&ShillError, "SetCarrierCallback")); -} - void InternetOptionsHandler::SimOperationCallback(const base::ListValue* args) { std::string operation; if (args->GetSize() != 1 || !args->GetString(0, &operation)) { @@ -498,21 +407,9 @@ void InternetOptionsHandler::GetManagedPropertiesResult( const std::string& service_path, const base::DictionaryValue& onc_properties) { scoped_ptr<base::DictionaryValue> dictionary(onc_properties.DeepCopy()); - const NetworkState* network = GetNetworkState(service_path); - if (network) { - // Add additional non-ONC cellular properties to inform the UI. - if (network->type() == shill::kTypeCellular) { - dictionary->SetBoolean(kTagShowViewAccountButton, - ShowViewAccountButton(network)); - } - } web_ui()->CallJavascriptFunction(js_callback_function, *dictionary); } -void InternetOptionsHandler::UpdateCarrier() { - web_ui()->CallJavascriptFunction(kUpdateCarrierFunction); -} - void InternetOptionsHandler::DeviceListChanged() { if (!web_ui()) return; @@ -625,17 +522,6 @@ void InternetOptionsHandler::ConfigureNetwork(const base::ListValue* args) { NetworkConfigView::Show(service_path, GetNativeWindow()); } -void InternetOptionsHandler::ActivateNetwork(const base::ListValue* args) { - std::string guid; - if (args->GetSize() != 1 || !args->GetString(0, &guid)) { - NOTREACHED(); - return; - } - std::string service_path = ServicePathFromGuid(guid); - if (!service_path.empty()) - ui::NetworkConnect::Get()->ActivateCellular(service_path); -} - void InternetOptionsHandler::LoadVPNProvidersCallback( const base::ListValue* args) { UpdateVPNProviders(); diff --git a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.h b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.h index fe7475a..086d545 100644 --- a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.h +++ b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.h @@ -61,8 +61,6 @@ class InternetOptionsHandler : public ::options::OptionsPageUIHandler, // Callbacks to set network state properties. void ShowMorePlanInfoCallback(const base::ListValue* args); - void CarrierStatusCallback(); - void SetCarrierCallback(const base::ListValue* args); void SimOperationCallback(const base::ListValue* args); // Sets details_guid_ for event forwarding. @@ -89,9 +87,6 @@ class InternetOptionsHandler : public ::options::OptionsPageUIHandler, const std::string& service_path, const base::DictionaryValue& onc_properties); - // Called when carrier data has been updated to informs the JS. - void UpdateCarrier(); - // NetworkStateHandlerObserver void DeviceListChanged() override; void NetworkListChanged() override; @@ -113,7 +108,6 @@ class InternetOptionsHandler : public ::options::OptionsPageUIHandler, void AddVPNConnection(const base::ListValue* args); void AddNonVPNConnection(const base::ListValue* args); void ConfigureNetwork(const base::ListValue* args); - void ActivateNetwork(const base::ListValue* args); // Requests that a list of VPN providers enabled in the primary user's // profile be sent to JavaScript. 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", diff --git a/components/onc/docs/onc_spec.html b/components/onc/docs/onc_spec.html index e01186e..5f001fc 100644 --- a/components/onc/docs/onc_spec.html +++ b/components/onc/docs/onc_spec.html @@ -2328,6 +2328,15 @@ </span> </dd> + <dt class="field">PaymentPortal</dt> + <dd> + <span class="field_meta">(optional, read-only) + <span class="type">PaymentPortal</span> + </span> + Properties describing the online payment portal (OLP) at which a user can + sign up for or modify a mobile data plan. + </dd> + <dt class="field">PRLVersion</dt> <dd> <span class="field_meta">(optional, read-only) @@ -2494,6 +2503,35 @@ </dd> </dl> + <p><span class="type">PaymentPortal</span> type contains the following:</p> + <dl class="field_list"> + <dt class="field">Method</dt> + <dd> + <span class="field_meta">(required) + <span class="type">string</span> + </span> + The HTTP method to use, "GET" or "POST" + </dd> + + <dt class="field">PostData</dt> + <dd> + <span class="field_meta"> + (required if <span class="field">Method</span> is + <span class="value">POST</span>, otherwise ignored) + <span class="type">string</span> + </span> + The postdata to send. + </dd> + + <dt class="field">Url</dt> + <dd> + <span class="field_meta">(required) + <span class="type">string</span> + </span> + The URL for the portal. + </dd> + </dl> + <p><span class="type">CellularProvider</span> type contains the following:</p> <dl class="field_list"> <dt class="field">Name</dt> diff --git a/components/onc/onc_constants.cc b/components/onc/onc_constants.cc index 6e16845..7543b6ef 100644 --- a/components/onc/onc_constants.cc +++ b/components/onc/onc_constants.cc @@ -114,6 +114,7 @@ const char kMEID[] = "MEID"; const char kMIN[] = "MIN"; const char kModelID[] = "ModelID"; const char kNetworkTechnology[] = "NetworkTechnology"; +const char kPaymentPortal[] = "PaymentPortal"; const char kPRLVersion[] = "PRLVersion"; const char kRoamingHome[] = "Home"; const char kRoamingRequired[] = "Required"; @@ -158,13 +159,19 @@ const char kNetworkId[] = "NetworkId"; const char kShortName[] = "ShortName"; const char kLongName[] = "LongName"; const char kTechnology[] = "Technology"; -} // namespace cellular_apn +} // namespace cellular_found_network + +namespace cellular_payment_portal { +const char kMethod[] = "Method"; +const char kPostData[] = "PostData"; +const char kUrl[] = "Url"; +} // namespace cellular_payment_portal namespace sim_lock_status { const char kLockEnabled[] = "LockEnabled"; const char kLockType[] = "LockType"; const char kRetriesLeft[] = "RetriesLeft"; -} +} // namespace sim_lock_status namespace connection_state { const char kConnected[] = "Connected"; diff --git a/components/onc/onc_constants.h b/components/onc/onc_constants.h index a8084e8..4e8f0a5 100644 --- a/components/onc/onc_constants.h +++ b/components/onc/onc_constants.h @@ -132,6 +132,7 @@ ONC_EXPORT extern const char kMEID[]; ONC_EXPORT extern const char kMIN[]; ONC_EXPORT extern const char kModelID[]; ONC_EXPORT extern const char kNetworkTechnology[]; +ONC_EXPORT extern const char kPaymentPortal[]; ONC_EXPORT extern const char kPRLVersion[]; ONC_EXPORT extern const char kRoamingHome[]; ONC_EXPORT extern const char kRoamingRequired[]; @@ -178,6 +179,12 @@ ONC_EXPORT extern const char kLongName[]; ONC_EXPORT extern const char kTechnology[]; } // namespace cellular_found_network +namespace cellular_payment_portal { +ONC_EXPORT extern const char kMethod[]; +ONC_EXPORT extern const char kPostData[]; +ONC_EXPORT extern const char kUrl[]; +} // namespace cellular_payment_portal + namespace sim_lock_status { ONC_EXPORT extern const char kLockEnabled[]; ONC_EXPORT extern const char kLockType[]; |