Commit 4755ec56 authored by Justin Cohen's avatar Justin Cohen Committed by Commit Bot

[ios] More NTP full screen fixes.

Followup to crrev.com/c/1005912, missed another case where we need to inject
the status bar height for iOS10.

Bug: 819460
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I2749ac4d5fcf24edd446741e5927868e856dd4c6
Reviewed-on: https://chromium-review.googlesource.com/1026420Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553551}
parent a43fb027
......@@ -21,6 +21,17 @@
namespace {
const CGFloat kShiftTilesDownAnimationDuration = 0.2;
const CGFloat kShiftTilesUpAnimationDuration = 0.25;
UIEdgeInsets SafeAreaInsetsForViewWithinNTP(UIView* view) {
UIEdgeInsets insets = SafeAreaInsetsForView(view);
if (IsUIRefreshPhase1Enabled() && !base::ios::IsRunningOnIOS11OrLater()) {
// TODO(crbug.com/826369) Replace this when the NTP is contained by the
// BVC with |self.collectionController.topLayoutGuide.length|.
insets = UIEdgeInsetsMake(StatusBarHeight(), 0, 0, 0);
}
return insets;
}
} // namespace
@interface ContentSuggestionsHeaderSynchronizer ()<UIGestureRecognizerDelegate>
......@@ -169,12 +180,7 @@ initWithCollectionController:
}
if (self.shouldAnimateHeader) {
UIEdgeInsets insets = SafeAreaInsetsForView(self.collectionView);
if (IsUIRefreshPhase1Enabled() && !base::ios::IsRunningOnIOS11OrLater()) {
// TODO(crbug.com/826369) Replace this when the NTP is contained by the
// BVC with |self.collectionController.topLayoutGuide.length|.
insets = UIEdgeInsetsMake(StatusBarHeight(), 0, 0, 0);
}
UIEdgeInsets insets = SafeAreaInsetsForViewWithinNTP(self.collectionView);
[self.headerController
updateFakeOmniboxForOffset:self.collectionView.contentOffset.y
screenWidth:self.collectionView.frame.size.width
......@@ -185,10 +191,11 @@ initWithCollectionController:
- (void)updateFakeOmniboxOnNewWidth:(CGFloat)width {
if (self.shouldAnimateHeader &&
(IsUIRefreshPhase1Enabled() || !IsIPadIdiom())) {
UIEdgeInsets insets = SafeAreaInsetsForViewWithinNTP(self.collectionView);
[self.headerController
updateFakeOmniboxForOffset:self.collectionView.contentOffset.y
screenWidth:width
safeAreaInsets:SafeAreaInsetsForView(self.collectionView)];
safeAreaInsets:insets];
} else {
[self.headerController updateFakeOmniboxForWidth:width];
}
......
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