Index: chrome/browser/profiles/profiles_state.cc |
diff --git a/chrome/browser/profiles/profiles_state.cc b/chrome/browser/profiles/profiles_state.cc |
index c19fb3320552689b4db4b94df019485d30d535b0..8552cdf606c84819aab06963619d0a3551381ae0 100644 |
--- a/chrome/browser/profiles/profiles_state.cc |
+++ b/chrome/browser/profiles/profiles_state.cc |
@@ -94,6 +94,15 @@ base::string16 GetAvatarButtonTextForProfile(Profile* profile) { |
void UpdateProfileName(Profile* profile, |
const base::string16& new_profile_name) { |
PrefService* pref_service = profile->GetPrefs(); |
+ ProfileInfoCache& cache = |
+ g_browser_process->profile_manager()->GetProfileInfoCache(); |
+ |
+ // This is only called when updating the profile name through the UI, |
+ // so we can assume the user has done this on purpose. |
+ size_t profile_index = cache.GetIndexOfProfileWithPath(profile->GetPath()); |
+ if (profile_index != std::string::npos) |
+ pref_service->SetBoolean(prefs::kProfileUsingDefaultName, false); |
+ |
// Updating the profile preference will cause the cache to be updated for |
// this preference. |
pref_service->SetString(prefs::kProfileName, |