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

Unified Diff: chrome/browser/chromeos/login/login_utils.cc

Issue 611383007: Clear user session flags before restarting Chrome for guest mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698