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_; } |