Commit d1103684 authored by rouslan@chromium.org's avatar rouslan@chromium.org

Revert of Introduce SessionManager that will contain code to start user...

Revert of Introduce SessionManager that will contain code to start user session on Chrome OS (https://codereview.chromium.org/318853004/)

Reason for revert:
Appears to have broken the kiosk and auth browser tests in http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%28dbg%29%281%29/builds/30916

Original issue's description:
> Introduce SessionManager that will contain code to start user session on Chrome OS
> 
> Move profile creation / session initialization (prefs/RLZ) as well as some of OAuth session init
> related code from LoginUtils to SessionManager. LoginUtils will temporarily implement
> SessionManager::Delegate interface till existing test coverage is migrated from LoginUtils interface.
> SessionManager will later use concept of UserSession (see design proposal at http://goto/cros-login-c14n).
> 
> LoginUtils::OnPrepareProfile() is split into
> StartSession()
> --PreStartSession() - things like switching logging dest
> --CreateUserSession() - will eventually create UserSession instance
> --StartCrosSession() - notify cros::SessionManager
> --NotifyUserLoggedIn() - UserManager::UserLoggedIn()
> --PrepareProfile()
> 
> PrepareProfile() - calls PM::CreateProfileAsync()
> --OnProfileCreated()
> ----InitProfilePreferences() - early initialization
> ----UserProfileInitialized()
> ------transfer signin profile auth date (cookies/proxy auth/certs)
> ------RestoreAuthSessionImpl() - OAuth2LoginManager::RestoreSession()
> ----FinalizePrepareProfile(()
> ------Own TPM (if it didn't happen for some reason)
> ------Notify SAML offline signin limiter
> ------Notify ProfileImpl
> ------chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED
> ------InitRLZ (for primary user)
>   
> 
> Minor cleanup
> * Unify DemoApp profile initialization flow with regular one
> * Don't pass display_email to LoginUtils::PrepareProfile
> * Move powerwash related prefs registration to ResetScreenHandler
> * Cleanup M31 migration code for |prefs::kProfileIsManaged| in LoginUtilsImpl::InitProfilePreferences()
> 
> BUG=370175,276163
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=276626

TBR=antrim@chromium.org,bauerb@chromium.org,nkostylev@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=370175,276163

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276760 0039d316-1c4b-4281-b951-d872f2087c98
parent 834e0623
......@@ -160,6 +160,7 @@ void KioskProfileLoader::OnLoginSuccess(const UserContext& user_context) {
if (context.GetUserID() == UserManager::kGuestUserName)
context.SetUserID(DemoAppLauncher::kDemoUserName);
LoginUtils::Get()->PrepareProfile(context,
std::string(), // display email
false, // has_cookies
false, // has_active_session
this);
......
......@@ -50,7 +50,6 @@
#include "chrome/browser/chromeos/login/lock/screen_locker.h"
#include "chrome/browser/chromeos/login/login_utils.h"
#include "chrome/browser/chromeos/login/login_wizard.h"
#include "chrome/browser/chromeos/login/session/session_manager.h"
#include "chrome/browser/chromeos/login/startup_utils.h"
#include "chrome/browser/chromeos/login/users/user.h"
#include "chrome/browser/chromeos/login/users/user_manager.h"
......@@ -162,6 +161,7 @@ class StubLogin : public LoginStatusConsumer,
if (!profile_prepared_) {
// Will call OnProfilePrepared in the end.
LoginUtils::Get()->PrepareProfile(user_context,
std::string(), // display_email
false, // has_cookies
true, // has_active_session
this);
......@@ -236,7 +236,7 @@ void OptionallyRunChromeOSLoginManager(const CommandLine& parsed_command_line,
// We did not log in (we crashed or are debugging), so we need to
// restore Sync.
SessionManager::GetInstance()->RestoreAuthenticationSession(profile);
LoginUtils::Get()->RestoreAuthenticationSession(profile);
}
}
}
......@@ -632,8 +632,8 @@ void ChromeBrowserMainPartsChromeos::PostProfileInit() {
login_user);
}
// This is done in SessionManager::OnProfileCreated during normal login.
SessionManager::GetInstance()->InitRlz(profile());
// This is done in LoginUtils::OnProfileCreated during normal login.
LoginUtils::Get()->InitRlzDelayed(profile());
// Send the PROFILE_PREPARED notification and call SessionStarted()
// so that the Launcher and other Profile dependent classes are created.
......
......@@ -775,18 +775,14 @@ void ExistingUserController::OnLoginSuccess(const UserContext& user_context) {
login_performer_->set_delegate(NULL);
ignore_result(login_performer_.release());
// Update user's displayed email.
if (!display_email_.empty()) {
UserManager::Get()->SaveUserDisplayEmail(user_context.GetUserID(),
display_email_);
display_email_.clear();
}
// Will call OnProfilePrepared() in the end.
LoginUtils::Get()->PrepareProfile(user_context,
display_email_,
has_cookies,
false, // Start session for user.
this);
display_email_.clear();
}
void ExistingUserController::OnProfilePrepared(Profile* profile) {
......
......@@ -242,7 +242,7 @@ IN_PROC_BROWSER_TEST_F(ExistingUserControllerTest, ExistingUserLogin) {
EXPECT_CALL(*mock_login_utils_, CreateAuthenticator(_))
.Times(1)
.WillOnce(WithArg<0>(CreateAuthenticator(user_context)));
EXPECT_CALL(*mock_login_utils_, PrepareProfile(user_context, _, _, _))
EXPECT_CALL(*mock_login_utils_, PrepareProfile(user_context, _, _, _, _))
.Times(1)
.WillOnce(InvokeWithoutArgs(&profile_prepared_cb_,
&base::Callback<void(void)>::Run));
......@@ -308,7 +308,7 @@ IN_PROC_BROWSER_TEST_F(ExistingUserControllerTest,
base::Bind(&MockUserManager::AddUser,
base::Unretained(mock_user_manager_),
kNewUsername);
EXPECT_CALL(*mock_login_utils_, PrepareProfile(user_context, _, _, _))
EXPECT_CALL(*mock_login_utils_, PrepareProfile(user_context, _, _, _, _))
.Times(1)
.WillOnce(DoAll(
InvokeWithoutArgs(&add_user_cb,
......@@ -432,7 +432,7 @@ class ExistingUserControllerPublicSessionTest
EXPECT_CALL(*mock_login_utils_, CreateAuthenticator(_))
.Times(1)
.WillOnce(WithArg<0>(CreateAuthenticator(user_context)));
EXPECT_CALL(*mock_login_utils_, PrepareProfile(user_context, _, _, _))
EXPECT_CALL(*mock_login_utils_, PrepareProfile(user_context, _, _, _, _))
.Times(1)
.WillOnce(InvokeWithoutArgs(&profile_prepared_cb_,
&base::Callback<void(void)>::Run));
......
......@@ -55,6 +55,7 @@ void FakeLoginUtils::DoBrowserLaunch(Profile* profile,
}
void FakeLoginUtils::PrepareProfile(const UserContext& user_context,
const std::string& display_email,
bool has_cookies,
bool has_active_session,
LoginUtils::Delegate* delegate) {
......@@ -94,12 +95,24 @@ void FakeLoginUtils::CompleteOffTheRecordLogin(const GURL& start_url) {
NOTREACHED() << "Method not implemented.";
}
void FakeLoginUtils::SetFirstLoginPrefs(PrefService* prefs) {
NOTREACHED() << "Method not implemented.";
}
scoped_refptr<Authenticator> FakeLoginUtils::CreateAuthenticator(
LoginStatusConsumer* consumer) {
authenticator_ = new MockAuthenticator(consumer, expected_user_context_);
return authenticator_;
}
void FakeLoginUtils::RestoreAuthenticationSession(Profile* profile) {
NOTREACHED() << "Method not implemented.";
}
void FakeLoginUtils::InitRlzDelayed(Profile* user_profile) {
NOTREACHED() << "Method not implemented.";
}
void FakeLoginUtils::SetExpectedCredentials(const UserContext& user_context) {
expected_user_context_ = user_context;
if (authenticator_) {
......
......@@ -24,13 +24,17 @@ class FakeLoginUtils : public LoginUtils {
virtual void DoBrowserLaunch(Profile* profile,
LoginDisplayHost* login_host) OVERRIDE;
virtual void PrepareProfile(const UserContext& user_context,
const std::string& display_email,
bool has_cookies,
bool has_active_session,
LoginUtils::Delegate* delegate) OVERRIDE;
virtual void DelegateDeleted(LoginUtils::Delegate* delegate) OVERRIDE;
virtual void CompleteOffTheRecordLogin(const GURL& start_url) OVERRIDE;
virtual void SetFirstLoginPrefs(PrefService* prefs) OVERRIDE;
virtual scoped_refptr<Authenticator> CreateAuthenticator(
LoginStatusConsumer* consumer) OVERRIDE;
virtual void RestoreAuthenticationSession(Profile* profile) OVERRIDE;
virtual void InitRlzDelayed(Profile* user_profile) OVERRIDE;
void SetExpectedCredentials(const UserContext& user_context);
void set_should_launch_browser(bool should_launch_browser) {
......
......@@ -10,6 +10,7 @@
#include "base/memory/ref_counted.h"
class GURL;
class PrefRegistrySimple;
class PrefService;
class Profile;
......@@ -33,12 +34,15 @@ class LoginUtils {
#if defined(ENABLE_RLZ)
// Called after post-profile RLZ initialization.
virtual void OnRlzInitialized() {}
virtual void OnRlzInitialized(Profile* profile) {}
#endif
protected:
virtual ~Delegate() {}
};
// Registers log-in related preferences.
static void RegisterPrefs(PrefRegistrySimple* registry);
// Get LoginUtils singleton object. If it was not set before, new default
// instance will be created.
static LoginUtils* Get();
......@@ -60,12 +64,15 @@ class LoginUtils {
LoginDisplayHost* login_host) = 0;
// Loads and prepares profile for the session. Fires |delegate| in the end.
// If |display_email| is not empty, user's displayed email will be set to
// this value, shown in UI.
// |user_context.username_hash| defines when user homedir is mounted.
// Also see DelegateDeleted method.
// If |has_active_session| is true than this is a case of restoring user
// session after browser crash so no need to start new session.
virtual void PrepareProfile(
const UserContext& user_context,
const std::string& display_email,
bool has_cookies,
bool has_active_session,
Delegate* delegate) = 0;
......@@ -78,6 +85,10 @@ class LoginUtils {
// |start_url| is url for launched browser to open.
virtual void CompleteOffTheRecordLogin(const GURL& start_url) = 0;
// Invoked when the user is logging in for the first time, or is logging in as
// a guest user.
virtual void SetFirstLoginPrefs(PrefService* prefs) = 0;
// Creates and returns the authenticator to use.
// Before WebUI login (Up to R14) the caller owned the returned
// Authenticator instance and had to delete it when done.
......@@ -89,6 +100,12 @@ class LoginUtils {
// TODO(nkostylev): Cleanup after WebUI login migration is complete.
virtual scoped_refptr<Authenticator> CreateAuthenticator(
LoginStatusConsumer* consumer) = 0;
// Restores authentication session after crash.
virtual void RestoreAuthenticationSession(Profile* profile) = 0;
// Initialize RLZ.
virtual void InitRlzDelayed(Profile* user_profile) = 0;
};
} // namespace chromeos
......
......@@ -358,7 +358,7 @@ class LoginUtilsTest : public testing::Test,
}
#if defined(ENABLE_RLZ)
virtual void OnRlzInitialized() OVERRIDE {
virtual void OnRlzInitialized(Profile* profile) OVERRIDE {
rlz_initialized_cb_.Run();
}
#endif
......@@ -411,6 +411,7 @@ class LoginUtilsTest : public testing::Test,
const bool kHasActiveSession = false;
user_context.SetAuthFlow(UserContext::AUTH_FLOW_GAIA_WITHOUT_SAML);
LoginUtils::Get()->PrepareProfile(user_context,
std::string(),
kHasCookies,
kHasActiveSession,
this);
......
......@@ -21,7 +21,7 @@ void MockLoginUtils::DelegateToFake() {
FakeLoginUtils* fake = fake_login_utils_.get();
ON_CALL(*this, DoBrowserLaunch(_, _))
.WillByDefault(Invoke(fake, &FakeLoginUtils::DoBrowserLaunch));
ON_CALL(*this, PrepareProfile(_, _, _, _))
ON_CALL(*this, PrepareProfile(_, _, _, _, _))
.WillByDefault(Invoke(fake, &FakeLoginUtils::PrepareProfile));
ON_CALL(*this, CreateAuthenticator(_))
.WillByDefault(Invoke(fake, &FakeLoginUtils::CreateAuthenticator));
......
......@@ -31,18 +31,21 @@ class MockLoginUtils : public LoginUtils {
virtual ~MockLoginUtils();
MOCK_METHOD2(DoBrowserLaunch, void(Profile*, LoginDisplayHost*));
MOCK_METHOD4(PrepareProfile,
void(const UserContext&,
MOCK_METHOD5(PrepareProfile,
void(const UserContext&, const std::string&,
bool, bool, LoginUtils::Delegate*));
MOCK_METHOD1(DelegateDeleted, void(LoginUtils::Delegate*));
MOCK_METHOD1(CompleteOffTheRecordLogin, void(const GURL&));
MOCK_METHOD1(SetFirstLoginPrefs, void(PrefService*));
MOCK_METHOD1(CreateAuthenticator,
scoped_refptr<Authenticator>(LoginStatusConsumer*));
MOCK_METHOD1(RestoreAuthenticationSession, void(Profile*));
MOCK_METHOD1(StartTokenServices, void(Profile*));
MOCK_METHOD2(TransferDefaultCookiesAndServerBoundCerts,
void(Profile*, Profile*));
MOCK_METHOD2(TransferDefaultAuthCache, void(Profile*, Profile*));
MOCK_METHOD0(StopBackgroundFetchers, void(void));
MOCK_METHOD1(InitRlzDelayed, void(Profile*));
void DelegateToFake();
FakeLoginUtils* GetFakeLoginUtils();
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SESSION_SESSION_MANAGER_H_
#define CHROME_BROWSER_CHROMEOS_LOGIN_SESSION_SESSION_MANAGER_H_
#include <string>
#include "base/basictypes.h"
#include "base/memory/singleton.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/chromeos/login/auth/authenticator.h"
#include "chrome/browser/chromeos/login/auth/user_context.h"
#include "chrome/browser/chromeos/login/signin/oauth2_login_manager.h"
#include "net/base/network_change_notifier.h"
class PrefRegistrySimple;
class PrefService;
class Profile;
namespace chromeos {
// SessionManager is responsible for starting user session which includes:
// load and initialize Profile (including custom Profile preferences),
// mark user as logged in and notify observers,
// initialize OAuth2 authentication session,
// initialize and launch user session based on the user type.
class SessionManager :
public OAuth2LoginManager::Observer,
public net::NetworkChangeNotifier::ConnectionTypeObserver,
public base::SupportsWeakPtr<SessionManager> {
public:
class Delegate {
public:
// Called after profile is loaded and prepared for the session.
virtual void OnProfilePrepared(Profile* profile) = 0;
#if defined(ENABLE_RLZ)
// Called after post-profile RLZ initialization.
virtual void OnRlzInitialized() {}
#endif
protected:
virtual ~Delegate() {}
};
// Returns SessionManager instance.
static SessionManager* GetInstance();
// Registers session related preferences.
static void RegisterPrefs(PrefRegistrySimple* registry);
// OAuth2LoginManager::Observer overrides:
virtual void OnSessionRestoreStateChanged(
Profile* user_profile,
OAuth2LoginManager::SessionRestoreState state) OVERRIDE;
virtual void OnNewRefreshTokenAvaiable(Profile* user_profile) OVERRIDE;
// net::NetworkChangeNotifier::ConnectionTypeObserver overrides:
virtual void OnConnectionTypeChanged(
net::NetworkChangeNotifier::ConnectionType type) OVERRIDE;
// Start user session given |user_context| and |authenticator| which holds
// authentication context (profile).
void StartSession(const UserContext& user_context,
scoped_refptr<Authenticator> authenticator,
bool has_cookies,
bool has_active_session,
Delegate* delegate);
// Restores authentication session after crash.
void RestoreAuthenticationSession(Profile* profile);
// Initialize RLZ.
void InitRlz(Profile* profile);
// TODO(nkostylev): Drop these methods once LoginUtilsImpl::AttemptRestart()
// is migrated.
OAuth2LoginManager::SessionRestoreStrategy GetSigninSessionRestoreStrategy();
bool exit_after_session_restore() { return exit_after_session_restore_; }
void set_exit_after_session_restore(bool value) {
exit_after_session_restore_ = value;
}
// Invoked when the user is logging in for the first time, or is logging in as
// a guest user.
static void SetFirstLoginPrefs(PrefService* prefs);
private:
friend struct DefaultSingletonTraits<SessionManager>;
typedef std::set<std::string> SessionRestoreStateSet;
SessionManager();
virtual ~SessionManager();
void CreateUserSession(const UserContext& user_context,
bool has_cookies);
void PreStartSession();
void StartCrosSession();
void NotifyUserLoggedIn();
void PrepareProfile();
// Callback for asynchronous profile creation.
void OnProfileCreated(const std::string& user_id,
bool is_incognito_profile,
Profile* profile,
Profile::CreateStatus status);
// Callback for Profile::CREATE_STATUS_CREATED profile state.
// Initializes basic preferences for newly created profile. Any other
// early profile initialization that needs to happen before
// ProfileManager::DoFinalInit() gets called is done here.
void InitProfilePreferences(Profile* profile,
const std::string& email);
// Callback for Profile::CREATE_STATUS_INITIALIZED profile state.
// Profile is created, extensions and promo resources are initialized.
void UserProfileInitialized(Profile* profile, bool is_incognito_profile);
// Callback to resume profile creation after transferring auth data from
// the authentication profile.
void CompleteProfileCreateAfterAuthTransfer(Profile* profile);
// Finalized profile preparation.
void FinalizePrepareProfile(Profile* profile);
// Initializes member variables needed for session restore process via
// OAuthLoginManager.
void InitSessionRestoreStrategy();
// Restores GAIA auth cookies for the created user profile from OAuth2 token.
void RestoreAuthSessionImpl(Profile* profile,
bool restore_from_auth_cookies);
// Initializes RLZ. If |disabled| is true, RLZ pings are disabled.
void InitRlzImpl(Profile* profile, bool disabled);
Delegate* delegate_;
// Authentication/user context.
UserContext user_context_;
scoped_refptr<Authenticator> authenticator_;
// True if the authentication context cookie jar should contain
// authentication cookies from the authentication extension log in flow.
bool has_web_auth_cookies_;
// OAuth2 session related members.
// True if we should restart chrome right after session restore.
bool exit_after_session_restore_;
// Sesion restore strategy.
OAuth2LoginManager::SessionRestoreStrategy session_restore_strategy_;
// OAuth2 refresh token for session restore.
std::string oauth2_refresh_token_;
// Set of user_id for those users that we should restore authentication
// session when notified about online state change.
SessionRestoreStateSet pending_restore_sessions_;
DISALLOW_COPY_AND_ASSIGN(SessionManager);
};
} // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_LOGIN_SESSION_SESSION_MANAGER_H_
......@@ -18,6 +18,7 @@ TestLoginUtils::~TestLoginUtils() {}
void TestLoginUtils::PrepareProfile(
const UserContext& user_context,
const std::string& display_email,
bool has_cookies,
bool has_active_session,
Delegate* delegate) {
......@@ -35,4 +36,7 @@ scoped_refptr<Authenticator> TestLoginUtils::CreateAuthenticator(
return new MockAuthenticator(consumer, expected_user_context_);
}
void TestLoginUtils::InitRlzDelayed(Profile* user_profile) {
}
} // namespace chromeos
......@@ -27,13 +27,17 @@ class TestLoginUtils : public LoginUtils {
virtual void DoBrowserLaunch(Profile* profile,
LoginDisplayHost* login_host) OVERRIDE {}
virtual void PrepareProfile(const UserContext& user_context,
const std::string& display_email,
bool has_cookies,
bool has_active_session,
Delegate* delegate) OVERRIDE;
virtual void DelegateDeleted(Delegate* delegate) OVERRIDE;
virtual void CompleteOffTheRecordLogin(const GURL& start_url) OVERRIDE {}
virtual void SetFirstLoginPrefs(PrefService* prefs) OVERRIDE {}
virtual scoped_refptr<Authenticator> CreateAuthenticator(
LoginStatusConsumer* consumer) OVERRIDE;
virtual void RestoreAuthenticationSession(Profile* profile) OVERRIDE {}
virtual void InitRlzDelayed(Profile* user_profile) OVERRIDE;
private:
UserContext expected_user_context_;
......
......@@ -35,7 +35,6 @@
#include "chrome/browser/chromeos/login/auth/user_context.h"
#include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h"
#include "chrome/browser/chromeos/login/login_utils.h"
#include "chrome/browser/chromeos/login/session/session_manager.h"
#include "chrome/browser/chromeos/login/signin/auth_sync_observer.h"
#include "chrome/browser/chromeos/login/signin/auth_sync_observer_factory.h"
#include "chrome/browser/chromeos/login/ui/login_display.h"
......@@ -1201,7 +1200,7 @@ void UserManagerImpl::OnProfilePrepared(Profile* profile) {
// users once it is fully multi-profile aware. http://crbug.com/238987
// For now if we have other user pending sessions they'll override OAuth
// session restore for previous users.
SessionManager::GetInstance()->RestoreAuthenticationSession(profile);
LoginUtils::Get()->RestoreAuthenticationSession(profile);
}
// Restore other user sessions if any.
......@@ -2034,6 +2033,7 @@ void UserManagerImpl::RestorePendingUserSessions() {
user_context.SetIsUsingOAuth(false);
// Will call OnProfilePrepared() once profile has been loaded.
LoginUtils::Get()->PrepareProfile(user_context,
std::string(), // display_email
false, // has_cookies
true, // has_active_session
this);
......
......@@ -24,7 +24,7 @@
#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
#include "chrome/browser/chromeos/drive/file_system_util.h"
#include "chrome/browser/chromeos/input_method/input_method_util.h"
#include "chrome/browser/chromeos/login/session/session_manager.h"
#include "chrome/browser/chromeos/login/login_utils.h"
#include "chrome/browser/chromeos/login/users/user.h"
#include "chrome/browser/chromeos/system/input_device_settings.h"
#include "chrome/browser/download/download_prefs.h"
......@@ -361,10 +361,10 @@ void Preferences::Init(PrefServiceSyncable* prefs, const User* user) {
ApplyPreferences(REASON_INITIALIZATION, "");
// If a guest is logged in, initialize the prefs as if this is the first
// login. For a regular user this is done in
// SessionManager::InitProfilePreferences().
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession))
SessionManager::SetFirstLoginPrefs(prefs);
// login.
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) {
LoginUtils::Get()->SetFirstLoginPrefs(prefs);
}
}
void Preferences::InitUserPrefsForTesting(PrefServiceSyncable* prefs,
......
......@@ -144,8 +144,8 @@
#include "chrome/browser/chromeos/file_system_provider/service.h"
#include "chrome/browser/chromeos/first_run/first_run.h"
#include "chrome/browser/chromeos/login/default_pinned_apps_field_trial.h"
#include "chrome/browser/chromeos/login/login_utils.h"
#include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter.h"
#include "chrome/browser/chromeos/login/session/session_manager.h"
#include "chrome/browser/chromeos/login/startup_utils.h"
#include "chrome/browser/chromeos/login/users/avatar/user_image_manager.h"
#include "chrome/browser/chromeos/login/users/avatar/user_image_sync_observer.h"
......@@ -170,7 +170,6 @@
#include "chrome/browser/ui/webui/chromeos/charger_replacement_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/hid_detection_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
#else
#include "chrome/browser/extensions/default_apps.h"
......@@ -297,15 +296,14 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
chromeos::default_pinned_apps_field_trial::RegisterPrefs(registry);
chromeos::language_prefs::RegisterPrefs(registry);
chromeos::KioskAppManager::RegisterPrefs(registry);
chromeos::LoginUtils::RegisterPrefs(registry);
chromeos::MultiProfileUserController::RegisterPrefs(registry);
chromeos::HIDDetectionScreenHandler::RegisterPrefs(registry);
chromeos::NetworkScreenHandler::RegisterPrefs(registry);
chromeos::Preferences::RegisterPrefs(registry);
chromeos::proxy_config::RegisterPrefs(registry);
chromeos::RegisterDisplayLocalStatePrefs(registry);
chromeos::ResetScreenHandler::RegisterPrefs(registry);
chromeos::ServicesCustomizationDocument::RegisterPrefs(registry);
chromeos::SessionManager::RegisterPrefs(registry);
chromeos::SigninScreenHandler::RegisterPrefs(registry);
chromeos::system::AutomaticRebootManager::RegisterPrefs(registry);
chromeos::UserImageManager::RegisterPrefs(registry);
......
......@@ -14,7 +14,6 @@
#include "base/files/file_path.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram.h"
#include "base/prefs/pref_registry_simple.h"
#include "base/prefs/pref_service.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
......@@ -224,12 +223,6 @@ void ResetScreenHandler::OnRollbackCheck(bool can_rollback) {
ShowWithParams();
}
// static
void ResetScreenHandler::RegisterPrefs(PrefRegistrySimple* registry) {
registry->RegisterBooleanPref(prefs::kFactoryResetRequested, false);
registry->RegisterBooleanPref(prefs::kRollbackRequested, false);
}
void ResetScreenHandler::Initialize() {
if (!page_is_ready() || !delegate_)
return;
......
......@@ -14,8 +14,6 @@
#include "chromeos/dbus/update_engine_client.h"
#include "content/public/browser/web_ui.h"
class PrefRegistrySimple;
namespace chromeos {
// WebUI implementation of ResetScreenActor.
......@@ -45,9 +43,6 @@ class ResetScreenHandler : public ResetScreenActor,
void OnRollbackCheck(bool can_rollback);
// Registers Local State preferences.
static void RegisterPrefs(PrefRegistrySimple* registry);
private:
// JS messages handlers.
void HandleOnCancel();
......
......@@ -634,8 +634,6 @@
'browser/chromeos/login/screens/wrong_hwid_screen.cc',
'browser/chromeos/login/screens/wrong_hwid_screen.h',
'browser/chromeos/login/screens/wrong_hwid_screen_actor.h',
'browser/chromeos/login/session/session_manager.cc',
'browser/chromeos/login/session/session_manager.h',
'browser/chromeos/login/signin/auth_sync_observer.cc',
'browser/chromeos/login/signin/auth_sync_observer.h',
'browser/chromeos/login/signin/auth_sync_observer_factory.cc',
......
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