summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-19 22:33:58 +0000
committerzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-19 22:33:58 +0000
commit7b7d8fcbef7f7cf3ca045faf307c59c405660d2e (patch)
tree3617c9f66e0f9c9ae56c095f0be3877c66a454f1
parent1e5b6a9f6ced7f42c6faf3fcf3effa918ea7e378 (diff)
downloadchromium_src-7b7d8fcbef7f7cf3ca045faf307c59c405660d2e.zip
chromium_src-7b7d8fcbef7f7cf3ca045faf307c59c405660d2e.tar.gz
chromium_src-7b7d8fcbef7f7cf3ca045faf307c59c405660d2e.tar.bz2
Revert 118373 - Merge 118361 - Changed account details button from the settings page to redirect to payment portal (not activation page). This should work with portals that require either GET or POST at landing.
BUG=chromium-os:24522 TEST=make sure that account details button from the settings page take you to payment portal not activation flow Review URL: https://chromiumcodereview.appspot.com/9249049 TBR=zelidrag@chromium.org Review URL: https://chromiumcodereview.appspot.com/9254041 TBR=zelidrag@chromium.org Review URL: https://chromiumcodereview.appspot.com/9268001 git-svn-id: svn://svn.chromium.org/chrome/branches/963/src@118379 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/cros/network_library.cc21
-rw-r--r--chrome/browser/chromeos/cros/network_library.h3
-rw-r--r--chrome/browser/resources/options/chromeos/internet_options.js2
-rw-r--r--chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc8
-rw-r--r--chrome/browser/ui/webui/chromeos/mobile_setup_ui.h4
-rw-r--r--chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc20
-rw-r--r--chrome/browser/ui/webui/options/chromeos/internet_options_handler.h1
7 files changed, 11 insertions, 48 deletions
diff --git a/chrome/browser/chromeos/cros/network_library.cc b/chrome/browser/chromeos/cros/network_library.cc
index 2431563..5f8233d 100644
--- a/chrome/browser/chromeos/cros/network_library.cc
+++ b/chrome/browser/chromeos/cros/network_library.cc
@@ -35,7 +35,6 @@
#include "chrome/browser/chromeos/cros/onc_network_parser.h"
#include "chrome/browser/chromeos/cros_settings.h"
#include "chrome/browser/chromeos/network_login_observer.h"
-#include "chrome/browser/net/browser_url_util.h"
#include "chrome/common/time_format.h"
#include "content/public/browser/browser_thread.h"
#include "crypto/nss_util.h" // crypto::GetTPMTokenInfo() for 802.1X and VPN.
@@ -119,12 +118,6 @@ const int kRecentPlanPaymentHours = 6;
// If cellular device doesn't have SIM card, then retries are never used.
const int kDefaultSimUnlockRetriesCount = 999;
-// Redirect extension url for POST-ing url parameters to mobile account status
-// sites.
-const char kRedirectExtensionPage[] =
- "chrome-extension://iadeocfgjdjdmpenejdbfeaocpbikmab/redirect.html?"
- "autoPost=1";
-
// List of cellular operators names that should have data roaming always enabled
// to be able to connect to any network.
const char* kAlwaysInRoamingOperators[] = {
@@ -1161,20 +1154,6 @@ bool CellularNetwork::SupportsDataPlan() const {
return !usage_url().empty() || !payment_url().empty();
}
-GURL CellularNetwork::GetAccountInfoUrl() const {
- if (!post_data_.length())
- return GURL(payment_url());
-
- GURL base_url(kRedirectExtensionPage);
- GURL temp_url = chrome_browser_net::AppendQueryParameter(base_url,
- "post_data",
- post_data_);
- GURL redir_url = chrome_browser_net::AppendQueryParameter(temp_url,
- "formUrl",
- payment_url());
- return redir_url;
-}
-
std::string CellularNetwork::GetNetworkTechnologyString() const {
// No need to localize these cellular technology abbreviations.
switch (network_technology_) {
diff --git a/chrome/browser/chromeos/cros/network_library.h b/chrome/browser/chromeos/cros/network_library.h
index a48f246..f18d46a 100644
--- a/chrome/browser/chromeos/cros/network_library.h
+++ b/chrome/browser/chromeos/cros/network_library.h
@@ -18,7 +18,6 @@
#include "base/observer_list.h"
#include "base/string16.h"
#include "base/timer.h"
-#include "googleurl/src/gurl.h"
#include "third_party/cros/chromeos_network.h"
namespace base {
@@ -1085,8 +1084,6 @@ class CellularNetwork : public WirelessNetwork {
// Returns true if one of the usage_url_ / payment_url_ (or both) is defined.
bool SupportsDataPlan() const;
- // Return a URL for account info page.
- GURL GetAccountInfoUrl() const;
// Return a string representation of network technology.
std::string GetNetworkTechnologyString() const;
// Return a string representation of activation state.
diff --git a/chrome/browser/resources/options/chromeos/internet_options.js b/chrome/browser/resources/options/chromeos/internet_options.js
index 04ed13a..a983d66 100644
--- a/chrome/browser/resources/options/chromeos/internet_options.js
+++ b/chrome/browser/resources/options/chromeos/internet_options.js
@@ -95,7 +95,7 @@ cr.define('options', function() {
OptionsPage.closeOverlay();
});
$('viewAccountDetails').addEventListener('click', function(event) {
- chrome.send('showMorePlanInfo');
+ chrome.send('buyDataPlan');
OptionsPage.closeOverlay();
});
$('cellularApnUseDefault').addEventListener('click', function(event) {
diff --git a/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc b/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
index f341160..b9dedc6 100644
--- a/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
@@ -1399,7 +1399,8 @@ void MobileSetupHandler::StartActivationOnUIThread() {
////////////////////////////////////////////////////////////////////////////////
MobileSetupUI::MobileSetupUI(TabContents* contents)
- : ChromeWebUI(contents) {
+ : ChromeWebUI(contents),
+ frame_load_observer_(NULL) {
chromeos::CellularNetwork* network = GetCellularNetwork();
std::string service_path = network ? network->service_path() : std::string();
MobileSetupHandler* handler = new MobileSetupHandler(service_path);
@@ -1415,6 +1416,7 @@ MobileSetupUI::MobileSetupUI(TabContents* contents)
void MobileSetupUI::RenderViewCreated(RenderViewHost* host) {
ChromeWebUI::RenderViewCreated(host);
- // Destroyed by the corresponding RenderViewHost
- new PortalFrameLoadObserver(AsWeakPtr(), host);
+ // Destroyed by the corresponding RenderViewHost.
+ frame_load_observer_ =
+ new PortalFrameLoadObserver(AsWeakPtr(), host);
}
diff --git a/chrome/browser/ui/webui/chromeos/mobile_setup_ui.h b/chrome/browser/ui/webui/chromeos/mobile_setup_ui.h
index 30bfc0d..8af042c 100644
--- a/chrome/browser/ui/webui/chromeos/mobile_setup_ui.h
+++ b/chrome/browser/ui/webui/chromeos/mobile_setup_ui.h
@@ -9,6 +9,7 @@
#include "base/memory/weak_ptr.h"
#include "chrome/browser/ui/webui/chrome_web_ui.h"
+class PortalFrameLoadObserver;
// A custom WebUI that defines datasource for mobile setup registration page
// that is used in Chrome OS activate modem and perform plan subscription tasks.
class MobileSetupUI : public ChromeWebUI,
@@ -16,10 +17,13 @@ class MobileSetupUI : public ChromeWebUI,
public:
explicit MobileSetupUI(TabContents* contents);
+ void OnObserverDeleted();
+
private:
// ChromeWebUI overrides.
virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE;
+ PortalFrameLoadObserver* frame_load_observer_;
DISALLOW_COPY_AND_ASSIGN(MobileSetupUI);
};
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 69dc733..7527fc6 100644
--- a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
@@ -584,7 +584,7 @@ void InternetOptionsHandler::RegisterMessages() {
base::Bind(&InternetOptionsHandler::BuyDataPlanCallback,
base::Unretained(this)));
web_ui_->RegisterMessageCallback("showMorePlanInfo",
- base::Bind(&InternetOptionsHandler::ShowMorePlanInfoCallback,
+ base::Bind(&InternetOptionsHandler::BuyDataPlanCallback,
base::Unretained(this)));
web_ui_->RegisterMessageCallback("setApn",
base::Bind(&InternetOptionsHandler::SetApnCallback,
@@ -623,24 +623,6 @@ void InternetOptionsHandler::DisableCellularCallback(const ListValue* args) {
cros_->EnableCellularNetworkDevice(false);
}
-void InternetOptionsHandler::ShowMorePlanInfoCallback(const ListValue* args) {
- if (!web_ui())
- return;
- Browser* browser = BrowserList::FindBrowserWithFeature(
- Profile::FromWebUI(web_ui()), Browser::FEATURE_TABSTRIP);
- if (!browser)
- return;
-
- const chromeos::CellularNetwork* cellular = cros_->cellular_network();
- if (!cellular)
- return;
-
- browser->OpenURL(content::OpenURLParams(
- cellular->GetAccountInfoUrl(), content::Referrer(),
- NEW_FOREGROUND_TAB,
- content::PAGE_TRANSITION_LINK, false));
-}
-
void InternetOptionsHandler::BuyDataPlanCallback(const ListValue* args) {
if (!web_ui_)
return;
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 0c9cf32..e971a7b 100644
--- a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.h
+++ b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.h
@@ -93,7 +93,6 @@ class InternetOptionsHandler
void SetSimCardLockCallback(const base::ListValue* args);
void ChangePinCallback(const base::ListValue* args);
void ShareNetworkCallback(const base::ListValue* args);
- void ShowMorePlanInfoCallback(const ListValue* args);
// Populates the ui with the details of the given device path. This forces
// an overlay to be displayed in the UI.