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

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

Issue 651843003: [cros-login-refactor] Move CompleteOffTheRecordLogin to UserSessionManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment 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
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 ba7a87bdbf521dab3f87b748a8819d4f9d743e79..c707190a2ef8c35ba64ca1450a74fadc3fbcd93e 100644
--- a/chrome/browser/chromeos/login/login_utils.cc
+++ b/chrome/browser/chromeos/login/login_utils.cc
@@ -37,7 +37,6 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/chromeos/boot_times_loader.h"
#include "chrome/browser/chromeos/login/auth/chrome_cryptohome_authenticator.h"
-#include "chrome/browser/chromeos/login/chrome_restart_request.h"
#include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h"
#include "chrome/browser/chromeos/login/existing_user_controller.h"
#include "chrome/browser/chromeos/login/lock/screen_locker.h"
@@ -47,7 +46,6 @@
#include "chrome/browser/chromeos/login/session/user_session_manager.h"
#include "chrome/browser/chromeos/login/signin/oauth2_login_manager.h"
#include "chrome/browser/chromeos/login/signin/oauth2_login_manager_factory.h"
-#include "chrome/browser/chromeos/login/startup_utils.h"
#include "chrome/browser/chromeos/login/ui/input_events_blocker.h"
#include "chrome/browser/chromeos/login/ui/login_display_host.h"
#include "chrome/browser/chromeos/login/user_flow.h"
@@ -78,7 +76,6 @@
#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"
@@ -89,7 +86,6 @@
#include "net/base/network_change_notifier.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
-#include "url/gurl.h"
#if defined(USE_ATHENA)
#include "athena/main/public/athena_launcher.h"
@@ -193,7 +189,6 @@ class LoginUtilsImpl : public LoginUtils,
bool has_active_session,
LoginUtils::Delegate* delegate) override;
virtual void DelegateDeleted(LoginUtils::Delegate* delegate) override;
- virtual void CompleteOffTheRecordLogin(const GURL& start_url) override;
virtual scoped_refptr<Authenticator> CreateAuthenticator(
AuthStatusConsumer* consumer) override;
virtual bool RestartToApplyPerSessionFlagsIfNeed(Profile* profile,
@@ -404,38 +399,6 @@ bool LoginUtilsImpl::RestartToApplyPerSessionFlagsIfNeed(Profile* profile,
return true;
}
-void LoginUtilsImpl::CompleteOffTheRecordLogin(const GURL& start_url) {
- VLOG(1) << "Completing incognito login";
-
- // For guest session we ask session manager to restart Chrome with --bwsi
- // flag. We keep only some of the arguments of this process.
- const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
- CommandLine command_line(browser_command_line.GetProgram());
- std::string cmd_line_str =
- GetOffTheRecordCommandLine(start_url,
- StartupUtils::IsOobeCompleted(),
- 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.
- const CommandLine user_flags(CommandLine::NO_PROGRAM);
- if (!about_flags::AreSwitchesIdenticalToCurrentCommandLine(
- user_flags,
- *CommandLine::ForCurrentProcess(),
- NULL)) {
- DBusThreadManager::Get()->GetSessionManagerClient()->SetFlagsForUser(
- chromeos::login::kGuestUserName,
- CommandLine::StringVector());
- }
-
- RestartChrome(cmd_line_str);
-}
-
scoped_refptr<Authenticator> LoginUtilsImpl::CreateAuthenticator(
AuthStatusConsumer* consumer) {
// Screen locker needs new Authenticator instance each time.

Powered by Google App Engine
This is Rietveld 408576698