Commit d1d84af1 authored by Stepan Khapugin's avatar Stepan Khapugin Committed by Commit Bot

[multiball] Minimize code in startUpChromeUI.

Moves some process-scoped code from
-startUpChromeUIPostCrash:needRestoration:

* Break down scheduleTasksRequiringBVCWithBrowserState to not include
promo-related code. Promo logic will move to Scene.
* Move some calls to startUpAfterFirstWindowCreated

Bug: 1045658
Change-Id: Iab374d1fc4befedf1f51713d13e00ba4d108c02d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2087334
Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747173}
parent e5d35d10
...@@ -594,6 +594,14 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -594,6 +594,14 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
// This initialization must only happen once there's at least one Chrome window // This initialization must only happen once there's at least one Chrome window
// open. // open.
- (void)startUpAfterFirstWindowCreated { - (void)startUpAfterFirstWindowCreated {
// "Low priority" tasks
[_startupTasks registerForApplicationWillResignActiveNotification];
[self registerForOrientationChangeNotifications];
_launchOptions = nil;
[self scheduleTasksRequiringBVCWithBrowserState];
CustomizeUIAppearance(); CustomizeUIAppearance();
[self scheduleStartupCleanupTasks]; [self scheduleStartupCleanupTasks];
...@@ -638,16 +646,11 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -638,16 +646,11 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
[[CrashRestoreHelper alloc] initWithBrowser:self.mainBrowser]; [[CrashRestoreHelper alloc] initWithBrowser:self.mainBrowser];
} }
// "Low priority" tasks
[_startupTasks registerForApplicationWillResignActiveNotification];
[self registerForOrientationChangeNotifications];
[self.sceneController openTabFromLaunchOptions:_launchOptions [self.sceneController openTabFromLaunchOptions:_launchOptions
startupInformation:self startupInformation:self
appState:self.appState]; appState:self.appState];
_launchOptions = nil;
[self scheduleTasksRequiringBVCWithBrowserState]; [self scheduleShowPromo];
// Before bringing up the UI, make sure the launch mode is correct, and // Before bringing up the UI, make sure the launch mode is correct, and
// check for previous crashes. // check for previous crashes.
...@@ -1124,7 +1127,6 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -1124,7 +1127,6 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
base::TimeDelta::FromSeconds(kExternalFilesCleanupDelaySeconds), base::TimeDelta::FromSeconds(kExternalFilesCleanupDelaySeconds),
base::OnceClosure()); base::OnceClosure());
} }
[self scheduleShowPromo];
} }
- (void)scheduleDeleteDownloadsDirectory { - (void)scheduleDeleteDownloadsDirectory {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment