Commit 59e77c69 authored by Stepan Khapugin's avatar Stepan Khapugin Committed by Commit Bot

[multiball] Fix DCHECK with FRE in multiwindow.

Fix a DCHECK that happens when two scenes are shown in FRE and the user
goes to background and then foreground.
The crash happens because the check for "is first run happening" was
only checking the current scene.
Instead, check all the scenes for FRE before scheduling the promo.
This way the attempt to show a promo isn't happening. The promo involves
a blocking UI, and the attempt happens in the second scene, hence the
crash.

Bug: 1104123
Change-Id: I2008894d4698edbb4ba9d2f19a45bae6c8bff8b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2292299Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Reviewed-by: default avatarJérôme Lebel <jlebel@chromium.org>
Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#789060}
parent 59152d95
...@@ -766,11 +766,14 @@ const char kMultiWindowOpenInNewWindowHistogram[] = ...@@ -766,11 +766,14 @@ const char kMultiWindowOpenInNewWindowHistogram[] =
// Schedules presentation of the first eligible promo found, if any. // Schedules presentation of the first eligible promo found, if any.
- (void)scheduleShowPromo { - (void)scheduleShowPromo {
// Don't show promos if first run is shown. (Note: This flag is only YES // Don't show promos if first run is shown in any scene. (Note: This flag
// while the first run UI is visible. However, as this function is called // is only YES while the first run UI is visible. However, as this function
// immediately after the UI is shown, it's a safe check.) // is called immediately after the UI is shown, it's a safe check.)
if (self.sceneState.presentingFirstRunUI) for (SceneState* sceneState in self.sceneState.appState.connectedScenes) {
return; if (sceneState.presentingFirstRunUI) {
return;
}
}
// Don't show promos in Incognito mode. // Don't show promos in Incognito mode.
if (self.currentInterface == self.incognitoInterface) if (self.currentInterface == self.incognitoInterface)
return; return;
......
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