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

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

Issue 9432003: Disable multi-profile UI in managed mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 8 years, 10 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
Index: chrome/browser/profiles/profile_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 5dd29a2e2ca5fef4173c9f5719b0af70d9e9e05c..0a4a9570dbe7667920403c64b6c9f375cf2e8300 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -685,6 +685,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;
@@ -716,6 +718,7 @@ void ProfileManager::RegisterPrefs(PrefService* prefs) {
prefs->RegisterStringPref(prefs::kProfileLastUsed, "");
prefs->RegisterIntegerPref(prefs::kProfilesNumCreated, 1);
prefs->RegisterListPref(prefs::kProfilesLastActive);
+ prefs->RegisterBooleanPref(prefs::kInManagedMode, false);
Robert Sesek 2012/03/05 18:33:49 Is this pref not already registered?
Bernhard Bauer 2012/03/05 22:08:54 I forgot that in the previous CL :-(
}
size_t ProfileManager::GetNumberOfProfiles() {
@@ -843,6 +846,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();
@@ -854,7 +860,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) {
@@ -919,7 +924,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);
}
« no previous file with comments | « chrome/browser/profiles/avatar_menu_model.cc ('k') | chrome/browser/ui/webui/options2/browser_options_handler2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698