Chromium Code Reviews| Index: chrome/browser/profiles/profiles_state.cc |
| diff --git a/chrome/browser/profiles/profiles_state.cc b/chrome/browser/profiles/profiles_state.cc |
| index 3c8aa1b5c7e1dad3c39fdf2b10cbf5f2e55ca343..9b87b4dde33847bd6c03bb157ac498598f3d8df5 100644 |
| --- a/chrome/browser/profiles/profiles_state.cc |
| +++ b/chrome/browser/profiles/profiles_state.cc |
| @@ -84,32 +84,11 @@ base::string16 GetAvatarNameForProfile(Profile* profile) { |
| void UpdateProfileName(Profile* profile, |
| const base::string16& new_profile_name) { |
| - ProfileInfoCache& cache = |
| - g_browser_process->profile_manager()->GetProfileInfoCache(); |
| - base::FilePath profile_file_path = profile->GetPath(); |
| - size_t profile_index = cache.GetIndexOfProfileWithPath(profile_file_path); |
| - |
| - if ((new_profile_name == |
| - cache.GetGAIAGivenNameOfProfileAtIndex(profile_index)) || |
| - (new_profile_name == cache.GetGAIANameOfProfileAtIndex(profile_index))) { |
| - // Set the profile to use the GAIA name as the profile name. Note, this |
| - // is a little weird if the user typed their GAIA name manually but |
| - // it's not a big deal. |
| - cache.SetIsUsingGAIANameOfProfileAtIndex(profile_index, true); |
| - } else { |
| - PrefService* pref_service = profile->GetPrefs(); |
| - // Updating the profile preference will cause the cache to be updated for |
| - // this preference. |
| - pref_service->SetString(prefs::kProfileName, |
| - base::UTF16ToUTF8(new_profile_name)); |
| - |
| - // Changing the profile name can invalidate the profile index. |
| - profile_index = cache.GetIndexOfProfileWithPath(profile_file_path); |
| - if (profile_index == std::string::npos) |
| - return; |
| - |
| - cache.SetIsUsingGAIANameOfProfileAtIndex(profile_index, false); |
| - } |
| + PrefService* pref_service = profile->GetPrefs(); |
| + // Updating the profile preference will cause the cache to be updated for |
| + // this preference. |
| + pref_service->SetString(prefs::kProfileName, |
| + base::UTF16ToUTF8(new_profile_name)); |
|
rpetterson
2014/03/20 22:58:17
Do you need to know if it's a GAIA name or custom
noms (inactive)
2014/03/21 14:32:00
You don't. You're just updating the display, custo
|
| } |
| std::vector<std::string> GetSecondaryAccountsForProfile( |