Index: chrome/browser/chromeos/login/login_utils.cc |
diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc |
index 80c76fa43b4ffec72bc79d40a387acc68f44f043..af51d22289faecc45cb812d580d05496262196f0 100644 |
--- a/chrome/browser/chromeos/login/login_utils.cc |
+++ b/chrome/browser/chromeos/login/login_utils.cc |
@@ -78,6 +78,7 @@ |
#include "chromeos/dbus/dbus_thread_manager.h" |
#include "chromeos/dbus/session_manager_client.h" |
#include "chromeos/login/auth/user_context.h" |
+#include "chromeos/login/user_names.h" |
#include "chromeos/settings/cros_settings_names.h" |
#include "components/signin/core/browser/signin_manager.h" |
#include "components/user_manager/user.h" |
@@ -202,10 +203,10 @@ class LoginUtilsImpl : public LoginUtils, |
bool early_restart) OVERRIDE; |
// UserSessionManager::Delegate implementation: |
- virtual void OnProfilePrepared(Profile* profile) OVERRIDE; |
- #if defined(ENABLE_RLZ) |
- virtual void OnRlzInitialized() OVERRIDE; |
- #endif |
+ virtual void OnProfilePrepared(Profile* profile) OVERRIDE; |
+#if defined(ENABLE_RLZ) |
+ virtual void OnRlzInitialized() OVERRIDE; |
+#endif |
private: |
void DoBrowserLaunchInternal(Profile* profile, |
@@ -423,6 +424,16 @@ void LoginUtilsImpl::CompleteOffTheRecordLogin(const GURL& start_url) { |
browser_command_line, |
&command_line); |
+ // This makes sure that Chrome restarts with no per-session flags. The guest |
+ // profile will always have empty set of per-session flags. If this is not |
+ // done and device owner has some per-session flags, when Chrome is relaunched |
+ // the guest profile session flags will not match the current command line and |
+ // another restart will be attempted in order to reset the user flags for the |
+ // guest user. |
+ DBusThreadManager::Get()->GetSessionManagerClient()->SetFlagsForUser( |
+ chromeos::login::kGuestUserName, |
+ CommandLine::StringVector()); |
+ |
RestartChrome(cmd_line_str); |
} |