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

Unified Diff: chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc

Issue 10832148: Send e-mail to the verizon portal. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
diff --git a/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc b/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
index b83a10c313c024955d4ead5e6297247c2f284662..1b35dae69ff615b69d3a59ee83e324fc2e5f1b41 100644
--- a/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
@@ -22,6 +22,7 @@
#include "base/values.h"
#include "chrome/browser/chromeos/cros/cros_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/profiles/profile.h"
#include "chrome/browser/ui/browser_list.h"
@@ -67,6 +68,8 @@ const char kJsPortalFrameLoadFailedCallback[] =
const char kJsPortalFrameLoadCompletedCallback[] =
"mobile.MobileSetup.portalFrameLoadCompleted";
+const char kEmailParam[] = "&email=";
+
} // namespace
// Observes IPC messages from the rederer and notifies JS if frame loading error
@@ -314,8 +317,18 @@ void MobileSetupHandler::GetDeviceInfo(CellularNetwork* network,
return;
value->SetString("carrier", network->name());
value->SetString("payment_url", network->payment_url());
- if (network->using_post() && network->post_data().length())
- value->SetString("post_data", network->post_data());
+ if (network->using_post() && network->post_data().length()) {
+ 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) {
Nikita (slow) 2012/08/03 22:59:01 I don't think you need such check. If UserManager
rkc1 2012/08/03 23:08:15 Done.
+ post_data.append(kEmailParam).append(
zel 2012/08/03 22:29:55 no encoding here?
rkc1 2012/08/03 22:47:46 The post data is escaped in JS: http://code.google
zel 2012/08/03 23:09:01 no, that's not the same thing. it's escaped there
rkc1 2012/08/03 23:38:29 Done.
+ manager->GetLoggedInUser().display_email());
Nikita (slow) 2012/08/03 22:59:01 Add check if (manager->IsUserLoggedIn())
Nikita (slow) 2012/08/03 22:59:40 Otherwise it will return NULL when not in user ses
rkc1 2012/08/03 23:08:15 Thanks for catching this; I keep forgetting that w
+ }
+
+ value->SetString("post_data", post_data);
+ }
const chromeos::NetworkDevice* device =
cros->FindNetworkDeviceByPath(network->device_path());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698