Commit fa0007b2 authored by Justin Cohen's avatar Justin Cohen Committed by Commit Bot

[ios] Fix overscroll target for NTP.

Bug: 859440
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I28b4542d8752d3c8ee52f62aa2894dabf787a0d7
Reviewed-on: https://chromium-review.googlesource.com/1139606Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575606}
parent 6807a9f4
......@@ -81,6 +81,19 @@ const CGFloat kBackgroundLandscapeInset = 169;
#pragma mark - NTPHeaderViewAdapter
- (void)addToolbarView:(UIView*)toolbarView {
_toolBarView = toolbarView;
[self addSubview:toolbarView];
id<LayoutGuideProvider> layoutGuide = SafeAreaLayoutGuideForView(self);
[NSLayoutConstraint activateConstraints:@[
[toolbarView.leadingAnchor constraintEqualToAnchor:self.leadingAnchor],
[toolbarView.topAnchor constraintEqualToAnchor:layoutGuide.topAnchor],
[toolbarView.heightAnchor
constraintEqualToConstant:ntp_header::ToolbarHeight()],
[toolbarView.trailingAnchor constraintEqualToAnchor:self.trailingAnchor]
]];
}
- (void)addViewsToSearchField:(UIView*)searchField {
ToolbarButtonFactory* buttonFactory =
[[ToolbarButtonFactory alloc] initWithStyle:NORMAL];
......
......@@ -357,18 +357,7 @@ const UIEdgeInsets kSearchBoxStretchInsets = {3, 3, 3, 3};
- (void)addFakeTapView {
UIButton* fakeTapButton = [[UIButton alloc] init];
fakeTapButton.translatesAutoresizingMaskIntoConstraints = NO;
[self.headerView addSubview:fakeTapButton];
id<LayoutGuideProvider> layoutGuide =
SafeAreaLayoutGuideForView(self.headerView);
[NSLayoutConstraint activateConstraints:@[
[fakeTapButton.leadingAnchor
constraintEqualToAnchor:self.headerView.leadingAnchor],
[fakeTapButton.topAnchor constraintEqualToAnchor:layoutGuide.topAnchor],
[fakeTapButton.heightAnchor
constraintEqualToConstant:ntp_header::ToolbarHeight()],
[fakeTapButton.trailingAnchor
constraintEqualToAnchor:self.headerView.trailingAnchor]
]];
[self.headerView addToolbarView:fakeTapButton];
[fakeTapButton addTarget:self
action:@selector(fakeOmniboxTapped:)
forControlEvents:UIControlEventTouchUpInside];
......
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