Commit 932800dd authored by Kurt Horimoto's avatar Kurt Horimoto Committed by Commit Bot

[iOS] Don't attempt to present UI for new request if already presenting.

When a navigation occurs, all OverlayRequests are cancelled, which
triggers the dismissal of any presented overlay UI.  The request queue
is empty at this point, so if the newly-loaded page attempts to present
a dialog on load, it's possible that OverlayPresenterImpl will try to
show this dialog before the cancelled dialog's UI is finished being
dismissed.  This CL adds a check to prevent attempting to present if
already presenting.  If a cancelled overlay is being dismissed, the new
request's UI will be presented upon the completion of the dismissal.

Bug: 990966
Change-Id: Iee7e735b53c9844666d6ea7cc48168513d768f0f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1736182Reviewed-by: default avatarMike Dougherty <michaeldo@chromium.org>
Commit-Queue: Mike Dougherty <michaeldo@chromium.org>
Auto-Submit: Kurt Horimoto <kkhorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#684217}
parent 4f518dc0
...@@ -279,10 +279,12 @@ void OverlayPresenterImpl::BrowserDestroyed(Browser* browser) { ...@@ -279,10 +279,12 @@ void OverlayPresenterImpl::BrowserDestroyed(Browser* browser) {
void OverlayPresenterImpl::RequestAddedToQueue(OverlayRequestQueueImpl* queue, void OverlayPresenterImpl::RequestAddedToQueue(OverlayRequestQueueImpl* queue,
OverlayRequest* request) { OverlayRequest* request) {
// If |queue| is active and the added request is the front request, trigger // If |queue| is active, the added request is frontmost, and an overlay is not
// the UI presentation for that request. // currently being presented, trigger the UI presentation for that request.
if (queue == GetActiveQueue() && request == queue->front_request()) if (queue == GetActiveQueue() && request == queue->front_request() &&
!presenting_) {
PresentOverlayForActiveRequest(); PresentOverlayForActiveRequest();
}
} }
void OverlayPresenterImpl::QueuedRequestCancelled( void OverlayPresenterImpl::QueuedRequestCancelled(
......
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