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

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

Issue 2529103002: Add account_type into AccountId (Closed)
Patch Set: Fix MultiUserWindowManagerChromeOSTest.* Created 4 years 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..460bf6ecb91cb8276c8a08fe7012ef3c6b1b5e53 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,9 @@ 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() /* id */,
+ AccountType::UNKNOWN));
if (user && user->using_saml())
return GAIA_SCREEN_MODE_SAML_INTERSTITIAL;
@@ -406,7 +406,7 @@ 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() /* id */, AccountType::UNKNOWN)))
ShowWhitelistCheckFailedError();
}
@@ -451,12 +451,13 @@ void GaiaScreenHandler::HandleWebviewLoadAborted(
AccountId GaiaScreenHandler::GetAccountId(
const std::string& authenticated_email,
- const std::string& gaia_id) const {
+ const std::string& id,
+ const AccountType& 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, id, account_type);
if (account_id.GetUserEmail() != canonicalized_email) {
LOG(WARNING) << "Existing user '" << account_id.GetUserEmail()
@@ -481,7 +482,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, AccountType::GOOGLE));
user_context.SetKey(Key(password));
user_context.SetAuthCode(auth_code);
user_context.SetAuthFlow(using_saml
@@ -566,7 +567,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, AccountType::GOOGLE));
user_context.SetKey(Key(password));
user_context.SetAuthFlow(using_saml
? UserContext::AUTH_FLOW_GAIA_WITH_SAML
@@ -705,7 +707,7 @@ void GaiaScreenHandler::ShowGaiaScreenIfReady() {
Delegate()->LoadSigninWallpaper();
} else {
Delegate()->LoadWallpaper(user_manager::known_user::GetAccountId(
- populated_email_, std::string()));
+ populated_email_, std::string() /* id */, AccountType::UNKNOWN));
}
input_method::InputMethodManager* imm =

Powered by Google App Engine
This is Rietveld 408576698