| Index: chrome/browser/profiles/profile_manager.cc
|
| diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
|
| index 5da3be78b62c47c12387878f12773cef53f5a861..cbdf8361a3cb3bb80174677d535f34144c8332f7 100644
|
| --- a/chrome/browser/profiles/profile_manager.cc
|
| +++ b/chrome/browser/profiles/profile_manager.cc
|
| @@ -678,6 +678,8 @@ FilePath ProfileManager::GenerateNextProfileDirectoryPath() {
|
| PrefService* local_state = g_browser_process->local_state();
|
| DCHECK(local_state);
|
|
|
| + DCHECK(!local_state->GetBoolean(prefs::kInManagedMode));
|
| +
|
| // Create the next profile in the next available directory slot.
|
| int next_directory = local_state->GetInteger(prefs::kProfilesNumCreated);
|
| std::string profile_name = chrome::kMultiProfileDirPrefix;
|
| @@ -709,6 +711,7 @@ void ProfileManager::RegisterPrefs(PrefService* prefs) {
|
| prefs->RegisterStringPref(prefs::kProfileLastUsed, "");
|
| prefs->RegisterIntegerPref(prefs::kProfilesNumCreated, 1);
|
| prefs->RegisterListPref(prefs::kProfilesLastActive);
|
| + prefs->RegisterBooleanPref(prefs::kInManagedMode, false);
|
| }
|
|
|
| size_t ProfileManager::GetNumberOfProfiles() {
|
| @@ -836,6 +839,9 @@ bool ProfileManager::ShouldGoOffTheRecord() {
|
| }
|
|
|
| void ProfileManager::ScheduleProfileForDeletion(const FilePath& profile_dir) {
|
| + PrefService* local_state = g_browser_process->local_state();
|
| + DCHECK(!local_state->GetBoolean(prefs::kInManagedMode));
|
| +
|
| // If we're deleting the last profile, then create a new profile in its
|
| // place.
|
| ProfileInfoCache& cache = GetProfileInfoCache();
|
| @@ -847,7 +853,6 @@ void ProfileManager::ScheduleProfileForDeletion(const FilePath& profile_dir) {
|
|
|
| // 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) {
|
| @@ -912,7 +917,7 @@ ProfileManagerWithoutInit::ProfileManagerWithoutInit(
|
| void ProfileManager::RegisterTestingProfile(Profile* profile,
|
| bool add_to_cache) {
|
| RegisterProfile(profile, true);
|
| - if (add_to_cache){
|
| + if (add_to_cache) {
|
| InitProfileUserPrefs(profile);
|
| AddProfileToCache(profile);
|
| }
|
|
|