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

Unified Diff: components/signin/core/browser/mutable_profile_oauth2_token_service.cc

Issue 1094103005: Profile chooser on mac was passing wrong value to signin error controller. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 5 years, 8 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
Index: components/signin/core/browser/mutable_profile_oauth2_token_service.cc
diff --git a/components/signin/core/browser/mutable_profile_oauth2_token_service.cc b/components/signin/core/browser/mutable_profile_oauth2_token_service.cc
index b3a19f8730aa5b4c91ac4826eb356839d261c07d..849c7731fc76e784ab7c90948b1c661b353c4f30 100644
--- a/components/signin/core/browser/mutable_profile_oauth2_token_service.cc
+++ b/components/signin/core/browser/mutable_profile_oauth2_token_service.cc
@@ -112,13 +112,6 @@ MutableProfileOAuth2TokenService::AccountInfo::GetAccountId() const {
return account_id_;
}
-std::string
-MutableProfileOAuth2TokenService::AccountInfo::GetUsername() const {
- // TODO(rogerta): when |account_id| becomes the obfuscated gaia id, this
- // will need to be changed.
- return account_id_;
-}
-
GoogleServiceAuthError
MutableProfileOAuth2TokenService::AccountInfo::GetAuthStatus() const {
return last_auth_error_;
@@ -208,7 +201,16 @@ void MutableProfileOAuth2TokenService::LoadCredentials(
CancelAllRequests();
refresh_tokens().clear();
- loading_primary_account_id_ = primary_account_id;
+
+ // If the account_id is an email address, then canonicalize it. This
+ // is to support legacy account_ids, and will not be needed after
+ // switching to gaia-ids.
+ if (primary_account_id.find('@') != std::string::npos) {
+ loading_primary_account_id_ = gaia::CanonicalizeEmail(primary_account_id);
+ } else {
+ loading_primary_account_id_ = primary_account_id;
+ }
+
scoped_refptr<TokenWebData> token_web_data = client()->GetDatabase();
if (token_web_data.get())
web_data_service_request_ = token_web_data->GetAllTokens(this);

Powered by Google App Engine
This is Rietveld 408576698