Commit 2d7a23f7 authored by Olivier Robin's avatar Olivier Robin Committed by Commit Bot

Execute external intents on sceneStateDidHideModalOverlay

The intent is delayed when there is a blocking UI.
It is necessary to execute it after

Bug: 1125091
Change-Id: I434b36a6fa3cd3301452886cedc9898465a3c60f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2409300
Auto-Submit: Olivier Robin <olivierrobin@chromium.org>
Reviewed-by: default avatarStepan Khapugin <stkhapugin@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806959}
parent 9c58fe78
...@@ -494,11 +494,20 @@ const char kMultiWindowOpenInNewWindowHistogram[] = ...@@ -494,11 +494,20 @@ const char kMultiWindowOpenInNewWindowHistogram[] =
connectionInformation:self connectionInformation:self
startupInformation:self.mainController startupInformation:self.mainController
browserState:self.currentInterface.browserState]; browserState:self.currentInterface.browserState];
// It is necessary to reset the pendingUserActivity after handling it. if (sceneIsActive) {
// Handle the reset asynchronously to avoid interfering with other observers. // It is necessary to reset the pendingUserActivity after handling it.
dispatch_async(dispatch_get_main_queue(), ^{ // Handle the reset asynchronously to avoid interfering with other
self.sceneState.pendingUserActivity = nil; // observers.
}); dispatch_async(dispatch_get_main_queue(), ^{
self.sceneState.pendingUserActivity = nil;
});
}
}
- (void)sceneStateDidHideModalOverlay:(SceneState*)sceneState {
if (self.sceneState.activationLevel >= SceneActivationLevelForegroundActive) {
[self handleExternalIntents];
}
} }
#pragma mark - AppStateObserver #pragma mark - AppStateObserver
......
...@@ -55,6 +55,8 @@ typedef NS_ENUM(NSUInteger, SceneActivationLevel) { ...@@ -55,6 +55,8 @@ typedef NS_ENUM(NSUInteger, SceneActivationLevel) {
- (void)sceneStateWillShowModalOverlay:(SceneState*)sceneState; - (void)sceneStateWillShowModalOverlay:(SceneState*)sceneState;
// Notifies when presentingModalOverlay is being set to false. // Notifies when presentingModalOverlay is being set to false.
- (void)sceneStateWillHideModalOverlay:(SceneState*)sceneState; - (void)sceneStateWillHideModalOverlay:(SceneState*)sceneState;
// Notifies when presentingModalOverlay has been set to false.
- (void)sceneStateDidHideModalOverlay:(SceneState*)sceneState;
// Notifies when URLContexts have been added to |URLContextsToOpen|. // Notifies when URLContexts have been added to |URLContextsToOpen|.
- (void)sceneState:(SceneState*)sceneState - (void)sceneState:(SceneState*)sceneState
hasPendingURLs:(NSSet<UIOpenURLContext*>*)URLContexts hasPendingURLs:(NSSet<UIOpenURLContext*>*)URLContexts
......
...@@ -112,6 +112,10 @@ ...@@ -112,6 +112,10 @@
} }
_presentingModalOverlay = presentingModalOverlay; _presentingModalOverlay = presentingModalOverlay;
if (!presentingModalOverlay) {
[self.observers sceneStateDidHideModalOverlay:self];
}
} }
- (void)setURLContextsToOpen:(NSSet<UIOpenURLContext*>*)URLContextsToOpen { - (void)setURLContextsToOpen:(NSSet<UIOpenURLContext*>*)URLContextsToOpen {
......
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