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

Unified Diff: chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc

Issue 2529103002: Add account_type into AccountId (Closed)
Patch Set: Created 4 years, 1 month 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
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 5660e1b87073814c93868d46b3544c8357e58c44..fb27e8f380f2724a63b0bd950f19ad3cf3440681 100644
--- a/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc
@@ -88,9 +88,10 @@ GaiaScreenMode GetGaiaScreenMode(const std::string& email, bool use_offline) {
// If there's a populated email, we must check first that this user is using
// SAML in order to decide whether to show the interstitial page.
- const user_manager::User* user =
- user_manager::UserManager::Get()->FindUser(
- user_manager::known_user::GetAccountId(email, std::string()));
+ const user_manager::User* user = user_manager::UserManager::Get()->FindUser(
+ user_manager::known_user::GetAccountId(
+ email, std::string() /* gaia_id */,
+ std::string() /* account_type */));
if (user && user->using_saml())
return GAIA_SCREEN_MODE_SAML_INTERSTITIAL;
@@ -406,7 +407,8 @@ void GaiaScreenHandler::OnPortalDetectionCompleted(
void GaiaScreenHandler::HandleIdentifierEntered(const std::string& user_email) {
if (!Delegate()->IsUserWhitelisted(user_manager::known_user::GetAccountId(
- user_email, std::string() /* gaia_id */)))
+ user_email, std::string() /* gaia_id */,
+ std::string() /* account_type */)))
ShowWhitelistCheckFailedError();
}
@@ -451,12 +453,13 @@ void GaiaScreenHandler::HandleWebviewLoadAborted(
AccountId GaiaScreenHandler::GetAccountId(
const std::string& authenticated_email,
- const std::string& gaia_id) const {
+ const std::string& gaia_id,
+ const std::string& account_type) const {
const std::string canonicalized_email =
gaia::CanonicalizeEmail(gaia::SanitizeEmail(authenticated_email));
- const AccountId account_id =
- user_manager::known_user::GetAccountId(authenticated_email, gaia_id);
+ const AccountId account_id = user_manager::known_user::GetAccountId(
+ authenticated_email, gaia_id, account_type);
if (account_id.GetUserEmail() != canonicalized_email) {
LOG(WARNING) << "Existing user '" << account_id.GetUserEmail()
@@ -481,7 +484,7 @@ void GaiaScreenHandler::HandleCompleteAuthentication(
const std::string sanitized_email = gaia::SanitizeEmail(email);
Delegate()->SetDisplayEmail(sanitized_email);
- UserContext user_context(GetAccountId(email, gaia_id));
+ UserContext user_context(GetAccountId(email, gaia_id, AccountId::kGoogle));
user_context.SetKey(Key(password));
user_context.SetAuthCode(auth_code);
user_context.SetAuthFlow(using_saml
@@ -566,7 +569,8 @@ void GaiaScreenHandler::DoCompleteLogin(const std::string& gaia_id,
DCHECK(!gaia_id.empty());
const std::string sanitized_email = gaia::SanitizeEmail(typed_email);
Delegate()->SetDisplayEmail(sanitized_email);
- UserContext user_context(GetAccountId(typed_email, gaia_id));
+ UserContext user_context(
+ GetAccountId(typed_email, gaia_id, AccountId::kGoogle));
user_context.SetKey(Key(password));
user_context.SetAuthFlow(using_saml
? UserContext::AUTH_FLOW_GAIA_WITH_SAML
@@ -705,7 +709,8 @@ void GaiaScreenHandler::ShowGaiaScreenIfReady() {
Delegate()->LoadSigninWallpaper();
} else {
Delegate()->LoadWallpaper(user_manager::known_user::GetAccountId(
- populated_email_, std::string()));
+ populated_email_, std::string() /* gaia_id */,
+ std::string() /* account_type */));
}
input_method::InputMethodManager* imm =

Powered by Google App Engine
This is Rietveld 408576698