Commit 559cf5d0 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Fix NTP edge insets computation

The computation for the edge insets used by the NTP to resize itself
was using the fullscreen model which is updated too late to be used
here.
Instead, use directly the correct values.

Fixed: 1044329
Change-Id: Ibfe84cbe9abecd516f222e0e1d12a3fe6f1f7ca1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2019244Reviewed-by: default avatarOlivier Robin <olivierrobin@chromium.org>
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Auto-Submit: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735377}
parent 6b3fdf44
......@@ -2498,12 +2498,12 @@ NSString* const kBrowserViewControllerSnackbarCategory =
- (CGRect)ntpFrameForWebState:(web::WebState*)webState {
NewTabPageTabHelper* NTPHelper = NewTabPageTabHelper::FromWebState(webState);
DCHECK(NTPHelper && NTPHelper->IsActive());
// NTP expects to be laid out behind the bottom toolbar.
UIEdgeInsets viewportInsets = [self viewportInsetsForView:self.contentArea];
if (IsRegularXRegularSizeClass())
viewportInsets.bottom = 0.0;
if (IsSplitToolbarMode(self))
viewportInsets.top = 0;
// NTP is laid out only in the visible part of the screen.
UIEdgeInsets viewportInsets = UIEdgeInsetsZero;
if (!IsRegularXRegularSizeClass())
viewportInsets.bottom = [self bottomToolbarHeight];
if (!IsSplitToolbarMode(self))
viewportInsets.top = [self expandedTopToolbarHeight];
return UIEdgeInsetsInsetRect(self.contentArea.bounds, viewportInsets);
}
......
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