Chromium Code Reviews| Index: chrome/browser/profiles/profile_manager.cc |
| diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc |
| index 5e02bee7af2c79596de38be0bce4e63ec5fa946c..44b9ad90f7e719551501ba6b89fea6aedd29a168 100644 |
| --- a/chrome/browser/profiles/profile_manager.cc |
| +++ b/chrome/browser/profiles/profile_manager.cc |
| @@ -420,8 +420,8 @@ void ProfileManager::CreateProfileAsync( |
| std::string icon_url_std = base::UTF16ToASCII(icon_url); |
| if (profiles::IsDefaultAvatarIconUrl(icon_url_std, &icon_index)) { |
| // add profile to cache with user selected name and avatar |
| - cache.AddProfileToCache(profile_path, name, base::string16(), icon_index, |
| - supervised_user_id); |
| + cache.AddProfileToCache(profile_path, name, std::string(), |
| + base::string16(), icon_index, supervised_user_id); |
| } |
| if (!supervised_user_id.empty()) { |
| @@ -1203,9 +1203,8 @@ void ProfileManager::FinishDeletingProfile( |
| profile)->DisableForUser(); |
| } |
| - bool profile_is_signed_in = !cache.GetUserNameOfProfileAtIndex( |
| - cache.GetIndexOfProfileWithPath(profile_dir)).empty(); |
| - ProfileMetrics::LogProfileDelete(profile_is_signed_in); |
| + ProfileMetrics::LogProfileDelete(cache.ProfileIsAuthenticatedAtIndex( |
| + cache.GetIndexOfProfileWithPath(profile_dir))); |
| // Some platforms store passwords in keychains. They should be removed. |
| scoped_refptr<password_manager::PasswordStore> password_store = |
| PasswordStoreFactory::GetForProfile( |
| @@ -1257,13 +1256,17 @@ void ProfileManager::AddProfileToCache(Profile* profile) { |
| SigninManagerBase* signin_manager = |
| SigninManagerFactory::GetForProfile(profile); |
| - base::string16 username = base::UTF8ToUTF16( |
| - signin_manager->GetAuthenticatedUsername()); |
| + AccountTrackerService* account_tracker = |
| + AccountTrackerServiceFactory::GetForProfile(profile); |
| + AccountTrackerService::AccountInfo info = |
|
noms (inactive)
2015/05/06 01:05:54
nit: s/info/account_info maybe? 30 lines later inf
Roger Tawa OOO till Jul 10th
2015/05/11 16:09:57
Done.
|
| + account_tracker->GetAccountInfo( |
| + signin_manager->GetAuthenticatedAccountId()); |
| + base::string16 username = base::UTF8ToUTF16(info.email); |
| 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); |
| + // The ProfileInfoCache's info must match the Signin Manager. |
| + cache.SetAuthInfoOfProfileAtIndex(profile_index, info.gaia, username); |
| return; |
| } |
| @@ -1280,6 +1283,7 @@ void ProfileManager::AddProfileToCache(Profile* profile) { |
| cache.AddProfileToCache(profile->GetPath(), |
| profile_name, |
| + info.gaia, |
| username, |
| icon_index, |
| supervised_user_id); |