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

Unified Diff: trunk/src/chrome/browser/chromeos/login/multi_profile_user_controller.cc

Issue 167173002: Revert 251352 "cros: Enable multiprofile for everyone." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 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: trunk/src/chrome/browser/chromeos/login/multi_profile_user_controller.cc
===================================================================
--- trunk/src/chrome/browser/chromeos/login/multi_profile_user_controller.cc (revision 251356)
+++ trunk/src/chrome/browser/chromeos/login/multi_profile_user_controller.cc (working copy)
@@ -5,6 +5,7 @@
#include "chrome/browser/chromeos/login/multi_profile_user_controller.h"
#include "base/bind.h"
+#include "base/command_line.h"
#include "base/memory/scoped_ptr.h"
#include "base/prefs/pref_change_registrar.h"
#include "base/prefs/pref_registry_simple.h"
@@ -18,6 +19,7 @@
#include "chrome/browser/prefs/pref_service_syncable.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
+#include "chromeos/chromeos_switches.h"
#include "google_apis/gaia/gaia_auth_util.h"
namespace chromeos {
@@ -59,9 +61,18 @@
// static
void MultiProfileUserController::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
+ // Use "disabled" default if there is no user manager or no logged in user.
+ // This is true for signin profile (where the value does not matter) or
+ // for the primary user's profile. This essentially disables multiprofile
+ // unless the primary user has a policy to say otherwise.
+ const bool use_disable_default =
+ !CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kForceMultiProfileInTests) &&
+ (!UserManager::IsInitialized() ||
+ UserManager::Get()->GetLoggedInUsers().size() == 1);
registry->RegisterStringPref(
prefs::kMultiProfileUserBehavior,
- kBehaviorUnrestricted,
+ use_disable_default ? kBehaviorNotAllowed : kBehaviorUnrestricted,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
}

Powered by Google App Engine
This is Rietveld 408576698