| Index: chrome/browser/chromeos/login/session/user_session_manager.cc
|
| diff --git a/chrome/browser/chromeos/login/session/user_session_manager.cc b/chrome/browser/chromeos/login/session/user_session_manager.cc
|
| index deae260a89d55ada5258d47eedc5d03f67bd5d76..b9e78181fb5c3f223d47fe425013b97c43bcb764 100644
|
| --- a/chrome/browser/chromeos/login/session/user_session_manager.cc
|
| +++ b/chrome/browser/chromeos/login/session/user_session_manager.cc
|
| @@ -12,6 +12,7 @@
|
|
|
| #include "base/base_paths.h"
|
| #include "base/bind.h"
|
| +#include "base/callback_helpers.h"
|
| #include "base/command_line.h"
|
| #include "base/location.h"
|
| #include "base/logging.h"
|
| @@ -1748,11 +1749,6 @@ void UserSessionManager::DoBrowserLaunchInternal(Profile* profile,
|
|
|
| BootTimesRecorder::Get()->AddLoginTimeMarker("BrowserLaunched", false);
|
|
|
| - // Mark user session as started before creating browser window. Otherwise,
|
| - // ash would not activate the created browser window because it thinks
|
| - // user session is blocked.
|
| - session_manager::SessionManager::Get()->SessionStarted();
|
| -
|
| VLOG(1) << "Launching browser...";
|
| TRACE_EVENT0("login", "LaunchBrowser");
|
|
|
| @@ -1805,11 +1801,18 @@ void UserSessionManager::DoBrowserLaunchInternal(Profile* profile,
|
| std::make_pair(profile, fingerprint_feature_notification_controller));
|
| }
|
|
|
| + base::OnceClosure login_host_finalized_callback = base::BindOnce(
|
| + [] { session_manager::SessionManager::Get()->SessionStarted(); });
|
| +
|
| // Mark login host for deletion after browser starts. This
|
| // guarantees that the message loop will be referenced by the
|
| // browser before it is dereferenced by the login host.
|
| - if (login_host)
|
| - login_host->Finalize();
|
| + if (login_host) {
|
| + login_host->Finalize(std::move(login_host_finalized_callback));
|
| + } else {
|
| + base::ResetAndReturn(&login_host_finalized_callback).Run();
|
| + }
|
| +
|
| chromeos::BootTimesRecorder::Get()->LoginDone(
|
| user_manager::UserManager::Get()->IsCurrentUserNew());
|
|
|
|
|