summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoger Tawa <rogerta@chromium.org>2015-01-07 13:25:36 -0500
committerRoger Tawa <rogerta@chromium.org>2015-01-07 18:27:48 +0000
commitba2a59ed12c91272853b062a8eb212080ac9227b (patch)
tree074a3ee043dbf1c6fa8a5abcf5dc9252b2aa7e49
parentcff0699ac4a1bfabf5f0babf10f991f13e776b7e (diff)
downloadchromium_src-ba2a59ed12c91272853b062a8eb212080ac9227b.zip
chromium_src-ba2a59ed12c91272853b062a8eb212080ac9227b.tar.gz
chromium_src-ba2a59ed12c91272853b062a8eb212080ac9227b.tar.bz2
[Merge] This change needs to go to branch 2214.
(cherry picked from commit 191ba3661eae6a0466a16522e799c117187450ad) BUG=440133 Review URL: https://codereview.chromium.org/836323002 Cr-Commit-Position: refs/branch-heads/2214@{#395} Cr-Branched-From: 03655fd3f6d72165dc3c9bd2c89807305316fe6c-refs/heads/master@{#303346}
-rw-r--r--chrome/browser/profiles/profile_manager.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 1eceba9..a7b0fc8 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -1168,12 +1168,16 @@ void ProfileManager::AddProfileToCache(Profile* profile) {
if (profile->GetPath().DirName() != cache.GetUserDataDir())
return;
- if (cache.GetIndexOfProfileWithPath(profile->GetPath()) != std::string::npos)
- return;
-
base::string16 username = base::UTF8ToUTF16(profile->GetPrefs()->GetString(
prefs::kGoogleServicesUsername));
+ size_t profile_index = cache.GetIndexOfProfileWithPath(profile->GetPath());
+ if (profile_index != std::string::npos) {
+ // The ProfileInfoCache's username must match the Signin Manager's username.
+ cache.SetUserNameOfProfileAtIndex(profile_index, username);
+ return;
+ }
+
// Profile name and avatar are set by InitProfileUserPrefs and stored in the
// profile. Use those values to setup the cache entry.
base::string16 profile_name =