Commit 0462d471 authored by rkc@chromium.org's avatar rkc@chromium.org

Send e-mail to the verizon portal.

Add the e-mail field to the data we post to the Verizon portal. The portal on the other end will pick it up and use it to pre-populate the field on the payment page. This data is also mandatory for 4g devices.

R=zelidrag@chromium.org,nkostylev@chromium.org
BUG=134596


Review URL: https://chromiumcodereview.appspot.com/10832148

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150139 0039d316-1c4b-4281-b951-d872f2087c98
parent 58e29035
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "base/values.h" #include "base/values.h"
#include "chrome/browser/chromeos/cros/cros_library.h" #include "chrome/browser/chromeos/cros/cros_library.h"
#include "chrome/browser/chromeos/cros/network_library.h" #include "chrome/browser/chromeos/cros/network_library.h"
#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/chromeos/mobile/mobile_activator.h" #include "chrome/browser/chromeos/mobile/mobile_activator.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_list.h"
...@@ -36,6 +37,7 @@ ...@@ -36,6 +37,7 @@
#include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_message_handler.h" #include "content/public/browser/web_ui_message_handler.h"
#include "googleurl/src/gurl.h" #include "googleurl/src/gurl.h"
#include "googleurl/src/url_util.h"
#include "grit/browser_resources.h" #include "grit/browser_resources.h"
#include "grit/chromium_strings.h" #include "grit/chromium_strings.h"
#include "grit/generated_resources.h" #include "grit/generated_resources.h"
...@@ -67,6 +69,8 @@ const char kJsPortalFrameLoadFailedCallback[] = ...@@ -67,6 +69,8 @@ const char kJsPortalFrameLoadFailedCallback[] =
const char kJsPortalFrameLoadCompletedCallback[] = const char kJsPortalFrameLoadCompletedCallback[] =
"mobile.MobileSetup.portalFrameLoadCompleted"; "mobile.MobileSetup.portalFrameLoadCompleted";
const char kEmailParam[] = "&email=";
} // namespace } // namespace
// Observes IPC messages from the rederer and notifies JS if frame loading error // Observes IPC messages from the rederer and notifies JS if frame loading error
...@@ -314,8 +318,22 @@ void MobileSetupHandler::GetDeviceInfo(CellularNetwork* network, ...@@ -314,8 +318,22 @@ void MobileSetupHandler::GetDeviceInfo(CellularNetwork* network,
return; return;
value->SetString("carrier", network->name()); value->SetString("carrier", network->name());
value->SetString("payment_url", network->payment_url()); value->SetString("payment_url", network->payment_url());
if (network->using_post() && network->post_data().length()) if (network->using_post() && network->post_data().length()) {
value->SetString("post_data", network->post_data()); std::string post_data = network->post_data();
// Append the current e-mail address to the post data to allow Verizon
// to pre-populate it on their form.
chromeos::UserManager* manager = chromeos::UserManager::Get();
if (manager->IsUserLoggedIn()) {
url_canon::RawCanonOutputT<char> output;
std::string email = manager->GetLoggedInUser().display_email();
url_util::EncodeURIComponent(email.c_str(), email.length(), &output);
std::string escaped_email(output.data(), output.length());
post_data.append(kEmailParam).append(escaped_email);
}
value->SetString("post_data", post_data);
}
const chromeos::NetworkDevice* device = const chromeos::NetworkDevice* device =
cros->FindNetworkDeviceByPath(network->device_path()); cros->FindNetworkDeviceByPath(network->device_path());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment