Index: chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc |
diff --git a/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc |
index e71da5ac5ad0c8feda8938ab4b068de21232d264..47b2185e0e597b3856d65362cb4ba59fb82c6d56 100644 |
--- a/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc |
+++ b/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc |
@@ -217,6 +217,7 @@ void GaiaScreenHandler::LoadGaiaWithVersion( |
params.SetString("email", context.email); |
params.SetBoolean("isEnrollingConsumerManagement", |
is_enrolling_consumer_management); |
+ params.SetString("gapsCookie", context.gaps_cookie); |
UpdateAuthParams(¶ms, |
context.has_users, |
@@ -494,7 +495,8 @@ void GaiaScreenHandler::HandleCompleteAuthentication( |
const std::string& email, |
const std::string& password, |
const std::string& auth_code, |
- bool using_saml) { |
+ bool using_saml, |
+ const std::string& gaps_cookie) { |
if (!Delegate()) |
return; |
@@ -511,6 +513,7 @@ void GaiaScreenHandler::HandleCompleteAuthentication( |
user_context.SetAuthFlow(using_saml |
? UserContext::AUTH_FLOW_GAIA_WITH_SAML |
: UserContext::AUTH_FLOW_GAIA_WITHOUT_SAML); |
+ user_context.SetGAPSCookie(gaps_cookie); |
Delegate()->CompleteLogin(user_context); |
} |
@@ -932,6 +935,12 @@ void GaiaScreenHandler::LoadAuthExtension(bool force, |
context.has_users = !Delegate()->GetUsers().empty(); |
} |
+ if (!context.email.empty()) { |
+ context.gaps_cookie = |
+ user_manager::UserManager::Get()->GetKnownUserGAPSCookie( |
+ gaia::CanonicalizeEmail(context.email)); |
+ } |
+ |
populated_email_.clear(); |
LoadGaia(context); |