[lacros] Remove session restore logic in BrowserServiceLacros::NewWindow
This CL removes session restore logic in BrowserServiceLacros::NewWindow
that was introduced by a recent CL
https://chromium-review.googlesource.com/c/chromium/src/+/3344753.
This logic worked poorly for profiles with "Continue where you left off"
value in chrome://settings/onStartup -- the profile picker got always
skipped when such a profile was the last used one.
This logic was meant to support session restore after Chrome restart /
update but the removed code never did anything like that.
Bug: 1282286
Change-Id: I6285c62d410db220b98ea13bfadb0a6ebaad7cb7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3397053
Auto-Submit: Jan Krčál <jkrcal@chromium.org>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#960568}
diff --git a/chrome/browser/lacros/browser_service_lacros.cc b/chrome/browser/lacros/browser_service_lacros.cc
index b3afc4f..91dc695e 100644
--- a/chrome/browser/lacros/browser_service_lacros.cc
+++ b/chrome/browser/lacros/browser_service_lacros.cc
@@ -130,17 +130,13 @@
Profile* profile = ProfileManager::GetLastUsedProfileAllowedByPolicy();
DCHECK(profile) << "No last used profile is found.";
- bool session_restore_available = false;
- if (should_trigger_session_restore) {
- SessionService* session_service =
- SessionServiceFactory::GetForProfileForSessionRestore(profile);
- if (session_service && session_service->ShouldRestore(nullptr))
- session_restore_available = true;
- }
-
- if (ProfilePicker::ShouldShowAtLaunch() && !session_restore_available &&
- !incognito) {
- // Profile picker does not support passing through the incognito param.
+ if (ProfilePicker::ShouldShowAtLaunch() && !incognito) {
+ // Profile picker does not support passing through the incognito param. It
+ // also does not support passing though the `should_trigger_session_restore`
+ // param but that's true very common (left clicking the launcher icon) so
+ // we can't skip the picker in this case. The default behavior for the first
+ // browser window supports session restore, additional windows are opened
+ // blank and thus it works reasonably well for BrowserServiceLacros.
ProfilePicker::Show(
ProfilePicker::EntryPoint::kNewSessionOnExistingProcess);
} else {