summaryrefslogtreecommitdiffstats
path: root/google_apis
diff options
context:
space:
mode:
authordzhioev <dzhioev@chromium.org>2015-10-26 19:43:15 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-27 02:43:54 +0000
commit5f0b811546f719dfd53d46ca97c99593ef6124b0 (patch)
tree00f9901bca4c3c8113406fa81e90ef2468bc551e /google_apis
parent25e7fa5c27096e1f4d664de9f13d904ac2571910 (diff)
downloadchromium_src-5f0b811546f719dfd53d46ca97c99593ef6124b0.zip
chromium_src-5f0b811546f719dfd53d46ca97c99593ef6124b0.tar.gz
chromium_src-5f0b811546f719dfd53d46ca97c99593ef6124b0.tar.bz2
Fixed GAIA email prefill on Chrome OS.
The reason of regression is that newly added 'readOnlyEmail' was not added to Authenticator's SUPPORTED_PARAMETERS list, so the value of the parameter was filtered in screen_gaia_signin.js. BUG=545597 TEST=WebviewLoginTest.EmailPrefill browsertest Review URL: https://codereview.chromium.org/1415883003 Cr-Commit-Position: refs/heads/master@{#356218}
Diffstat (limited to 'google_apis')
-rw-r--r--google_apis/gaia/fake_gaia.cc3
-rw-r--r--google_apis/gaia/fake_gaia.h4
2 files changed, 7 insertions, 0 deletions
diff --git a/google_apis/gaia/fake_gaia.cc b/google_apis/gaia/fake_gaia.cc
index 94f8b42..a4a7d1d 100644
--- a/google_apis/gaia/fake_gaia.cc
+++ b/google_apis/gaia/fake_gaia.cc
@@ -486,6 +486,7 @@ void FakeGaia::HandleServiceLogin(const HttpRequest& request,
void FakeGaia::HandleEmbeddedSetupChromeos(const HttpRequest& request,
BasicHttpResponse* http_response) {
GURL request_url = GURL("http://localhost").Resolve(request.relative_url);
+
std::string client_id;
if (!GetQueryParameter(request_url.query(), "client_id", &client_id) ||
GaiaUrls::GetInstance()->oauth2_chrome_client_id() != client_id) {
@@ -494,6 +495,8 @@ void FakeGaia::HandleEmbeddedSetupChromeos(const HttpRequest& request,
return;
}
+ GetQueryParameter(request_url.query(), "Email", &prefilled_email_);
+
http_response->set_code(net::HTTP_OK);
http_response->set_content(embedded_setup_chromeos_response_);
http_response->set_content_type("text/html");
diff --git a/google_apis/gaia/fake_gaia.h b/google_apis/gaia/fake_gaia.h
index 05c44d5..ef955de 100644
--- a/google_apis/gaia/fake_gaia.h
+++ b/google_apis/gaia/fake_gaia.h
@@ -140,6 +140,9 @@ class FakeGaia {
return refresh_token_to_device_id_map_;
}
+ // Returns an email that is filled into the the Email field (if any).
+ const std::string& prefilled_email() { return prefilled_email_; }
+
protected:
// HTTP handler for /MergeSession.
virtual void HandleMergeSession(
@@ -232,6 +235,7 @@ class FakeGaia {
SamlAccountIdpMap saml_account_idp_map_;
bool issue_oauth_code_cookie_;
RefreshTokenToDeviceIdMap refresh_token_to_device_id_map_;
+ std::string prefilled_email_;
DISALLOW_COPY_AND_ASSIGN(FakeGaia);
};