Commit 1a468841 authored by Chris Lu's avatar Chris Lu Committed by Commit Bot

[ios] Return early if no previously active request

Normally, when the active WebState is being changed with a presenting
Overlay, the overlay's request will still be in the queue. However,
When multiple tabs are being simultaneously opened, there will be a
situation where the "last" active WebState has no requests, even though
presented_ in OverlayPresenter is true because the original presenting
overlay is still finishing its dismissal.

There is an assumption in SetActiveWebState() that if presented_ is
true,then there is an overlay in the queue to dismiss. In this
situation, which occurs in Popup Infobars often, that is not true.

Bug: 1121755
Change-Id: I45829c8abe81283cbc52a8c61acc5c9ecd17c8d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2382425
Commit-Queue: Mike Dougherty <michaeldo@chromium.org>
Reviewed-by: default avatarMike Dougherty <michaeldo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803965}
parent 1d7fb868
...@@ -157,6 +157,13 @@ void OverlayPresenterImpl::SetActiveWebState( ...@@ -157,6 +157,13 @@ void OverlayPresenterImpl::SetActiveWebState(
PresentOverlayForActiveRequest(); PresentOverlayForActiveRequest();
return; return;
} }
// If presenting_ is true and there is no previously active request, this
// is likely because the presenting overlay is still in the process of being
// dismissed and multiple tabs have been opened in the process.
if (!previously_active_request) {
return;
}
// If the active WebState changes while an overlay is being presented, the // If the active WebState changes while an overlay is being presented, the
// presented UI needs to be dismissed before the next overlay for the new // presented UI needs to be dismissed before the next overlay for the new
......
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