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

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

Issue 413453002: Canonicalize the authenticated username on iOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/signin/core/browser/signin_manager_base.cc
diff --git a/components/signin/core/browser/signin_manager_base.cc b/components/signin/core/browser/signin_manager_base.cc
index 52172e8f81bba051a7f8880b08974623035116a9..c121d5d0e7f6b6f22e804e868a350652015ddd32 100644
--- a/components/signin/core/browser/signin_manager_base.cc
+++ b/components/signin/core/browser/signin_manager_base.cc
@@ -41,8 +41,16 @@ void SigninManagerBase::Initialize(PrefService* local_state) {
std::string user =
client_->GetPrefs()->GetString(prefs::kGoogleServicesUsername);
- if (!user.empty())
+ if (!user.empty()) {
+#if defined(OS_IOS)
+ // Prior to M38, Chrome on iOS did not normalize the email before setting
+ // it in SigninManager. |AccountReconcilor| expects the authenticated email
+ // to be normalized as it used as an account identifier and is compared
+ // to the accounts available in the cookies.
+ user = gaia::CanonicalizeEmail(gaia::SanitizeEmail(user));
+#endif
SetAuthenticatedUsername(user);
+ }
}
bool SigninManagerBase::IsInitialized() const { return initialized_; }
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698