Commit 5b31ce10 authored by Chris Lu's avatar Chris Lu Committed by Commit Bot

[ios] Call FullscreenViewportInsetRangeChanged when resetting Fullscreen

When tab closures are undone, the max/min inset ranges are not set in
the new WKWebView before loading the page, because the session
restoration logic doesn't follow the new tab creation logic.

This change sets the max/min inset ranges whenever the Fullscreen
model is reset, which covers any change of the active WebState.
There will be no-op calls as a result of this since max/min inset
ranges change during rotations, but it shouldn't hurt performance.

Bug: 1149908
Change-Id: Ic94345d4e01854ab7addb70bf27f215b0f3cb590
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2552172
Commit-Queue: Mark Cogan <marq@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#830982}
parent 0abc18eb
......@@ -146,8 +146,12 @@ void FullscreenMediator::FullscreenModelWasReset(FullscreenModel* model) {
// callback occurs after the model's state is reset, and updating the model
// the with active animator's current value would overwrite the reset value.
StopAnimating(false /* update_model */);
// Update observers for the reset progress value.
// Update observers for the reset progress value and set the inset range in
// case this is a new WebState.
for (auto& observer : observers_) {
observer.FullscreenViewportInsetRangeChanged(
controller_, controller_->GetMinViewportInsets(),
controller_->GetMaxViewportInsets());
observer.FullscreenProgressUpdated(controller_, model_->progress());
}
......
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