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

Unified Diff: chrome/browser/profiles/profiles_state.cc

Issue 196473015: [Profiles] Don't treat GAIA names differently than regular profile names. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove useless comment Created 6 years, 9 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 | « chrome/browser/profiles/profile_info_interface.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « chrome/browser/profiles/profile_info_interface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698