Commit 0c7dc288 authored by edchin's avatar edchin Committed by Commit Bot

[ios] Fix NTP snapshot edge insets

There were two changes to NTP frame and inset calculation
that broke NTP snapshot insets and resulted in a snapshot
with a smaller frame than needed.

https://chromium-review.googlesource.com/c/chromium/src/+/1392956
https://chromium-review.googlesource.com/c/chromium/src/+/2019244

The NTP's fullscreen behavior is different from a regular
webpage in that the bottom toolbar stays fixed (in compact width
size class). Since the NTP's frame is always above the bottom
toolbar, there is no need to further inset the snapshot frame
on the bottom.

This CL fixes the snapshot inset.

Fixed: 1040101
Change-Id: I0f5c0289b873a031ac66550d1c4aca1f5a3e73cd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2073011Reviewed-by: default avataredchin <edchin@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Commit-Queue: edchin <edchin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#744758}
parent 9d517b8e
...@@ -2847,6 +2847,9 @@ NSString* const kBrowserViewControllerSnackbarCategory = ...@@ -2847,6 +2847,9 @@ NSString* const kBrowserViewControllerSnackbarCategory =
// be obstructed by the toolbars when the snapshot is displayed in the tab // be obstructed by the toolbars when the snapshot is displayed in the tab
// grid. In that case, the NTP should be inset by the maximum viewport // grid. In that case, the NTP should be inset by the maximum viewport
/// insets. /// insets.
// The NTP always sits above the bottom toolbar (when there is one) so the
// insets should not take into account the bottom toolbar.
maxViewportInsets.bottom = 0;
return [self canShowTabStrip] ? UIEdgeInsetsZero : maxViewportInsets; return [self canShowTabStrip] ? UIEdgeInsetsZero : maxViewportInsets;
} else { } else {
// If the NTP is inactive, the WebState's view is used as the base view for // If the NTP is inactive, the WebState's view is used as the base view for
......
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