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

[ios][multiball] Fix bugs with blocking UI.

1. Fix a bug when a blocking UI will show multiple times, but only
dismiss once, therefore leaving the scene blocked.
2. Fix a bug when the active scenes are not immediately obscured by the
overlay. Ideally we might not want to show this overlay unless the user
tries to interact with the scene, and initially I hoped to make it so by
observing when the scene becomes active; turns out multiple scenes can
be active at once. We might want to revisit it later.

Bug: 1096062, 1092824,
Change-Id: I978aa855d141e9ba5aa34f7b034a5f284a82ff25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2249959
Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org>
Auto-Submit: Stepan Khapugin <stkhapugin@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#780291}
parent 33972945
......@@ -186,11 +186,12 @@ initWithBrowserLauncher:(id<BrowserLauncher>)browserLauncher
- (void)setSceneShowingBlockingUI:(SceneState*)newScene {
_sceneShowingBlockingUI = newScene;
if (!newScene) {
for (SceneState* scene in self.connectedScenes) {
scene.presentingModalOverlay = false;
// When there's a scene with blocking UI, all other scenes should show the
// overlay.
BOOL shouldPresentOverlay = (newScene != nil) && (scene != newScene);
scene.presentingModalOverlay = shouldPresentOverlay;
}
}
}
#pragma mark - Public methods.
......
......@@ -430,6 +430,11 @@ const char kMultiWindowOpenInNewWindowHistogram[] =
// TODO(crbug.com/1072408): factor out into a new class.
- (void)displayBlockingOverlay {
if (self.blockingOverlayViewController) {
// The overlay is already displayed, nothing to do.
return;
}
// Make the window visible. This is because in safe mode it's not visible yet.
if (self.sceneState.window.hidden) {
[self.sceneState.window makeKeyAndVisible];
......
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