Commit 81ae53ce authored by xiyuan@chromium.org's avatar xiyuan@chromium.org

Reland 251352 "cros: Enable multiprofile for everyone."

> cros: Enable multiprofile for everyone.
>
> BUG=338941
> R=dpolukhin@chromium.org, nkostylev@chromium.org

R=dpolukhin@chromium.org, nkostylev@chromium.org

Review URL: https://codereview.chromium.org/146193005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251522 0039d316-1c4b-4281-b951-d872f2087c98
parent 6a8b1086
......@@ -832,7 +832,6 @@ class MultiProfileFileManagerBrowserTest : public FileManagerBrowserTestBase {
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
FileManagerBrowserTestBase::SetUpCommandLine(command_line);
command_line->AppendSwitch(switches::kMultiProfiles);
command_line->AppendSwitch(chromeos::switches::kForceMultiProfileInTests);
// Logs in to a dummy profile (For making MultiProfileWindowManager happy;
// browser test creates a default window and the manager tries to assign a
// user for it, and we need a profile connected to a user.)
......
......@@ -5,7 +5,6 @@
#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"
......@@ -19,7 +18,6 @@
#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 {
......@@ -61,18 +59,9 @@ void MultiProfileUserController::RegisterPrefs(
// 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,
use_disable_default ? kBehaviorNotAllowed : kBehaviorUnrestricted,
kBehaviorUnrestricted,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
}
......
......@@ -84,12 +84,7 @@ void SAMLOfflineSigninLimiterTest::CreateLimiter() {
}
void SAMLOfflineSigninLimiterTest::SetUp() {
const UserList user_list;
EXPECT_CALL(*user_manager_, GetLoggedInUsers())
.Times(1)
.WillOnce(ReturnRef(user_list));
profile_.reset(new TestingProfile);
Mock::VerifyAndClearExpectations(user_manager_);
SAMLOfflineSigninLimiterFactory::SetClockForTesting(&clock_);
user_manager_->AddUser(kTestUser);
......
......@@ -132,7 +132,6 @@ class ScreenLockerTest : public InProcessBrowserTest {
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
command_line->AppendSwitchASCII(switches::kLoginProfile, "user");
command_line->AppendSwitch(switches::kForceMultiProfileInTests);
}
scoped_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_;
......
......@@ -12,7 +12,6 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chromeos/chromeos_switches.h"
#include "content/public/test/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
......@@ -39,7 +38,6 @@ class UserAddingScreenTest : public LoginManagerTest,
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
LoginManagerTest::SetUpCommandLine(command_line);
command_line->AppendSwitch(::switches::kMultiProfiles);
command_line->AppendSwitch(switches::kForceMultiProfileInTests);
}
virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
......
......@@ -16,7 +16,6 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/ui_test_utils.h"
#include "chromeos/chromeos_switches.h"
#include "chromeos/settings/cros_settings_names.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test_utils.h"
......@@ -59,7 +58,6 @@ class AccountsOptionsTest : public LoginManagerTest {
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
LoginManagerTest::SetUpCommandLine(command_line);
command_line->AppendSwitch(::switches::kMultiProfiles);
command_line->AppendSwitch(switches::kForceMultiProfileInTests);
}
protected:
......
......@@ -16,7 +16,6 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/ui_test_utils.h"
#include "chromeos/chromeos_switches.h"
#include "chromeos/settings/cros_settings_names.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test_utils.h"
......@@ -59,7 +58,6 @@ class SharedOptionsTest : public LoginManagerTest {
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
LoginManagerTest::SetUpCommandLine(command_line);
command_line->AppendSwitch(::switches::kMultiProfiles);
command_line->AppendSwitch(switches::kForceMultiProfileInTests);
}
protected:
......
......@@ -149,11 +149,6 @@ const char kFirstExecAfterBoot[] = "first-exec-after-boot";
// tests can change how it's brought up. This flag disables that.
const char kForceLoginManagerInTests[] = "force-login-manager-in-tests";
// Sets primary user's default multiprofile behavior to 'unrestricted' for
// tests so that multiprofile is enabled for any user.
// TODO(xiyuan): Remove when multiprofile is released to everyone.
const char kForceMultiProfileInTests[] = "force-multi-profiles-in-tests";
// Makes GPU sandbox failures nonfatal.
const char kGpuSandboxFailuresNonfatal[] = "gpu-sandbox-failures-nonfatal";
......
......@@ -58,7 +58,6 @@ CHROMEOS_EXPORT extern const char kFileManagerEnableNewAudioPlayer[];
CHROMEOS_EXPORT extern const char kFileManagerEnableMultiProfile[];
CHROMEOS_EXPORT extern const char kFirstExecAfterBoot[];
CHROMEOS_EXPORT extern const char kForceLoginManagerInTests[];
CHROMEOS_EXPORT extern const char kForceMultiProfileInTests[];
CHROMEOS_EXPORT extern const char kGpuSandboxFailuresNonfatal[];
CHROMEOS_EXPORT extern const char kGuestSession[];
CHROMEOS_EXPORT extern const char kHasChromeOSDiamondKey[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment