diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc index 80c76fa43b4ff..2bb310455d35d 100644 --- a/chrome/browser/chromeos/login/login_utils.cc +++ b/chrome/browser/chromeos/login/login_utils.cc @@ -151,6 +151,11 @@ bool CanPerformEarlyRestart() { if (!base::SysInfo::IsRunningOnChromeOS()) return false; + if (!ChromeUserManager::Get()->GetCurrentUserFlow()-> + SupportsEarlyRestartToApplyFlags()) { + return false; + } + const ExistingUserController* controller = ExistingUserController::current_controller(); if (!controller) @@ -403,7 +408,7 @@ bool LoginUtilsImpl::RestartToApplyPerSessionFlagsIfNeed(Profile* profile, CommandLine::StringVector flags; // argv[0] is the program name |CommandLine::NO_PROGRAM|. flags.assign(user_flags.argv().begin() + 1, user_flags.argv().end()); - VLOG(1) << "Restarting to apply per-session flags..."; + LOG(WARNING) << "Restarting to apply per-session flags..."; DBusThreadManager::Get()->GetSessionManagerClient()->SetFlagsForUser( user_manager::UserManager::Get()->GetActiveUser()->email(), flags); AttemptRestart(profile); diff --git a/chrome/browser/chromeos/login/supervised/supervised_user_creation_flow.cc b/chrome/browser/chromeos/login/supervised/supervised_user_creation_flow.cc index b3631132f9bf7..294eec7536e53 100644 --- a/chrome/browser/chromeos/login/supervised/supervised_user_creation_flow.cc +++ b/chrome/browser/chromeos/login/supervised/supervised_user_creation_flow.cc @@ -52,6 +52,10 @@ bool SupervisedUserCreationFlow::ShouldSkipPostLoginScreens() { return true; } +bool SupervisedUserCreationFlow::SupportsEarlyRestartToApplyFlags() { + return false; +} + void SupervisedUserCreationFlow::HandleOAuthTokenStatusChange( user_manager::User::OAuthTokenStatus status) { if (status == user_manager::User::OAUTH_TOKEN_STATUS_UNKNOWN) diff --git a/chrome/browser/chromeos/login/supervised/supervised_user_creation_flow.h b/chrome/browser/chromeos/login/supervised/supervised_user_creation_flow.h index 5d063821a2f72..ff4d511083eac 100644 --- a/chrome/browser/chromeos/login/supervised/supervised_user_creation_flow.h +++ b/chrome/browser/chromeos/login/supervised/supervised_user_creation_flow.h @@ -25,6 +25,7 @@ class SupervisedUserCreationFlow : public ExtendedUserFlow { virtual bool ShouldShowSettings() OVERRIDE; virtual bool ShouldLaunchBrowser() OVERRIDE; virtual bool ShouldSkipPostLoginScreens() OVERRIDE; + virtual bool SupportsEarlyRestartToApplyFlags() OVERRIDE; virtual bool HandleLoginFailure(const AuthFailure& failure) OVERRIDE; virtual void HandleLoginSuccess(const UserContext& context) OVERRIDE; virtual bool HandlePasswordChangeDetected() OVERRIDE; diff --git a/chrome/browser/chromeos/login/supervised/supervised_user_login_flow.cc b/chrome/browser/chromeos/login/supervised/supervised_user_login_flow.cc index d6d7fb14d4a10..d90cfc1c007c6 100644 --- a/chrome/browser/chromeos/login/supervised/supervised_user_login_flow.cc +++ b/chrome/browser/chromeos/login/supervised/supervised_user_login_flow.cc @@ -47,6 +47,10 @@ bool SupervisedUserLoginFlow::ShouldSkipPostLoginScreens() { return true; } +bool SupervisedUserLoginFlow::SupportsEarlyRestartToApplyFlags() { + return false; +} + bool SupervisedUserLoginFlow::HandleLoginFailure(const AuthFailure& failure) { return false; } diff --git a/chrome/browser/chromeos/login/supervised/supervised_user_login_flow.h b/chrome/browser/chromeos/login/supervised/supervised_user_login_flow.h index 0bbe94b6bae4c..6afeb04ace317 100644 --- a/chrome/browser/chromeos/login/supervised/supervised_user_login_flow.h +++ b/chrome/browser/chromeos/login/supervised/supervised_user_login_flow.h @@ -27,6 +27,7 @@ class SupervisedUserLoginFlow virtual bool CanLockScreen() OVERRIDE; virtual bool ShouldLaunchBrowser() OVERRIDE; virtual bool ShouldSkipPostLoginScreens() OVERRIDE; + virtual bool SupportsEarlyRestartToApplyFlags() OVERRIDE; virtual bool HandleLoginFailure(const AuthFailure& failure) OVERRIDE; virtual void HandleLoginSuccess(const UserContext& context) OVERRIDE; virtual bool HandlePasswordChangeDetected() OVERRIDE; diff --git a/chrome/browser/chromeos/login/user_flow.cc b/chrome/browser/chromeos/login/user_flow.cc index fcfc9ca9e0709..ffec462348656 100644 --- a/chrome/browser/chromeos/login/user_flow.cc +++ b/chrome/browser/chromeos/login/user_flow.cc @@ -40,6 +40,10 @@ bool DefaultUserFlow::ShouldSkipPostLoginScreens() { return false; } +bool DefaultUserFlow::SupportsEarlyRestartToApplyFlags() { + return true; +} + bool DefaultUserFlow::HandleLoginFailure(const AuthFailure& failure) { return false; } diff --git a/chrome/browser/chromeos/login/user_flow.h b/chrome/browser/chromeos/login/user_flow.h index c487e26505cdf..7c17406457ba3 100644 --- a/chrome/browser/chromeos/login/user_flow.h +++ b/chrome/browser/chromeos/login/user_flow.h @@ -26,6 +26,7 @@ class UserFlow { virtual bool ShouldShowSettings() = 0; virtual bool ShouldLaunchBrowser() = 0; virtual bool ShouldSkipPostLoginScreens() = 0; + virtual bool SupportsEarlyRestartToApplyFlags() = 0; virtual bool HandleLoginFailure(const AuthFailure& failure) = 0; virtual void HandleLoginSuccess(const UserContext& context) = 0; virtual bool HandlePasswordChangeDetected() = 0; @@ -54,6 +55,7 @@ class DefaultUserFlow : public UserFlow { virtual bool ShouldShowSettings() OVERRIDE; virtual bool ShouldLaunchBrowser() OVERRIDE; virtual bool ShouldSkipPostLoginScreens() OVERRIDE; + virtual bool SupportsEarlyRestartToApplyFlags() OVERRIDE; virtual bool HandleLoginFailure(const AuthFailure& failure) OVERRIDE; virtual void HandleLoginSuccess(const UserContext& context) OVERRIDE; virtual bool HandlePasswordChangeDetected() OVERRIDE;