Chromium Code Reviews| Index: chrome/browser/profiles/profile_manager.cc |
| =================================================================== |
| --- chrome/browser/profiles/profile_manager.cc (revision 124933) |
| +++ chrome/browser/profiles/profile_manager.cc (working copy) |
| @@ -685,6 +685,8 @@ |
| PrefService* local_state = g_browser_process->local_state(); |
| DCHECK(local_state); |
| + DCHECK(!local_state->GetBoolean(prefs::kInManagedMode)); |
|
sail
2012/03/05 18:41:29
I don't think sprinkling these DCHECKs here is ver
|
| + |
| // Create the next profile in the next available directory slot. |
| int next_directory = local_state->GetInteger(prefs::kProfilesNumCreated); |
| std::string profile_name = chrome::kMultiProfileDirPrefix; |
| @@ -716,6 +718,7 @@ |
| prefs->RegisterStringPref(prefs::kProfileLastUsed, ""); |
| prefs->RegisterIntegerPref(prefs::kProfilesNumCreated, 1); |
| prefs->RegisterListPref(prefs::kProfilesLastActive); |
| + prefs->RegisterBooleanPref(prefs::kInManagedMode, false); |
| } |
| size_t ProfileManager::GetNumberOfProfiles() { |
| @@ -843,6 +846,9 @@ |
| } |
| void ProfileManager::ScheduleProfileForDeletion(const FilePath& profile_dir) { |
| + PrefService* local_state = g_browser_process->local_state(); |
| + DCHECK(!local_state->GetBoolean(prefs::kInManagedMode)); |
|
sail
2012/03/05 18:41:29
same as above
|
| + |
| // If we're deleting the last profile, then create a new profile in its |
| // place. |
| ProfileInfoCache& cache = GetProfileInfoCache(); |
| @@ -854,7 +860,6 @@ |
| // Update the last used profile pref before closing browser windows. This way |
| // the correct last used profile is set for any notification observers. |
| - PrefService* local_state = g_browser_process->local_state(); |
| std::string last_profile = local_state->GetString(prefs::kProfileLastUsed); |
| if (profile_dir.BaseName().MaybeAsASCII() == last_profile) { |
| for (size_t i = 0; i < cache.GetNumberOfProfiles(); ++i) { |
| @@ -919,7 +924,7 @@ |
| void ProfileManager::RegisterTestingProfile(Profile* profile, |
| bool add_to_cache) { |
| RegisterProfile(profile, true); |
| - if (add_to_cache){ |
| + if (add_to_cache) { |
| InitProfileUserPrefs(profile); |
| AddProfileToCache(profile); |
| } |