Commit 73b2f9fe authored by Mark Cogan's avatar Mark Cogan Committed by Commit Bot

[iOS] Remove unused relaxed hit test protocol.

Removes the unused RelaxedBoundsConstraintsHitTestSupport protocol and
references to it in OverscrollActionsController.

Change-Id: If4fb0ea6ad8a01ee82af2f91b4b75aa1dac728c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2117115Reviewed-by: default avatarChris Lu <thegreenfrog@chromium.org>
Reviewed-by: default avatarKurt Horimoto <kkhorimoto@chromium.org>
Commit-Queue: Mark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753151}
parent b195b482
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.h" #import "ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.h"
#import "ios/chrome/browser/ui/util/relaxed_bounds_constraints_hittest.h"
#import "ios/web/public/ui/crw_web_view_scroll_view_proxy.h" #import "ios/web/public/ui/crw_web_view_scroll_view_proxy.h"
class ChromeBrowserState; class ChromeBrowserState;
...@@ -50,7 +49,7 @@ extern NSString* const kOverscrollActionsDidEnd; ...@@ -50,7 +49,7 @@ extern NSString* const kOverscrollActionsDidEnd;
// revealing the actions. // revealing the actions.
- (UIView*)toolbarSnapshotView; - (UIView*)toolbarSnapshotView;
// The header view over which the overscroll action view will be added. // The header view over which the overscroll action view will be added.
- (UIView<RelaxedBoundsConstraintsHitTestSupport>*)headerView; - (UIView*)headerView;
// Called to retrieve the top inset added to the scrollview for the header. // Called to retrieve the top inset added to the scrollview for the header.
- (CGFloat)overscrollActionsControllerHeaderInset: - (CGFloat)overscrollActionsControllerHeaderInset:
(OverscrollActionsController*)controller; (OverscrollActionsController*)controller;
......
...@@ -230,8 +230,6 @@ NSString* const kOverscrollActionsDidEnd = @"OverscrollActionsDidStop"; ...@@ -230,8 +230,6 @@ NSString* const kOverscrollActionsDidEnd = @"OverscrollActionsDidStop";
- (void)setup; - (void)setup;
// Resets scroll view's top content inset to |self.initialContentInset|. // Resets scroll view's top content inset to |self.initialContentInset|.
- (void)resetScrollViewTopContentInset; - (void)resetScrollViewTopContentInset;
// Access the headerView from the delegate.
- (UIView<RelaxedBoundsConstraintsHitTestSupport>*)headerView;
// Locking/unlocking methods used to disable/enable the overscroll actions // Locking/unlocking methods used to disable/enable the overscroll actions
// with a reference count. // with a reference count.
- (void)incrementOverscrollActionLockForNotification: - (void)incrementOverscrollActionLockForNotification:
...@@ -661,10 +659,6 @@ NSString* const kOverscrollActionsDidEnd = @"OverscrollActionsDidStop"; ...@@ -661,10 +659,6 @@ NSString* const kOverscrollActionsDidEnd = @"OverscrollActionsDidStop";
[self setScrollViewContentInset:insets]; [self setScrollViewContentInset:insets];
} }
- (UIView<RelaxedBoundsConstraintsHitTestSupport>*)headerView {
return [self.delegate headerView];
}
- (void)incrementOverscrollActionLockForNotification:(NSNotification*)notif { - (void)incrementOverscrollActionLockForNotification:(NSNotification*)notif {
if (![_lockIncrementNotifications containsObject:notif.name]) { if (![_lockIncrementNotifications containsObject:notif.name]) {
[_lockIncrementNotifications addObject:notif.name]; [_lockIncrementNotifications addObject:notif.name];
...@@ -759,11 +753,6 @@ NSString* const kOverscrollActionsDidEnd = @"OverscrollActionsDidStop"; ...@@ -759,11 +753,6 @@ NSString* const kOverscrollActionsDidEnd = @"OverscrollActionsDidStop";
[UIView beginAnimations:@"backgroundColor" context:NULL]; [UIView beginAnimations:@"backgroundColor" context:NULL];
switch (self.overscrollState) { switch (self.overscrollState) {
case OverscrollState::NO_PULL_STARTED: { case OverscrollState::NO_PULL_STARTED: {
UIView<RelaxedBoundsConstraintsHitTestSupport>* headerView =
[self headerView];
if ([headerView
respondsToSelector:@selector(setHitTestBoundsContraintRelaxed:)])
[headerView setHitTestBoundsContraintRelaxed:NO];
[self.overscrollActionView removeFromSuperview]; [self.overscrollActionView removeFromSuperview];
SetViewFrameHeight( SetViewFrameHeight(
self.overscrollActionView, self.overscrollActionView,
...@@ -782,6 +771,8 @@ NSString* const kOverscrollActionsDidEnd = @"OverscrollActionsDidStop"; ...@@ -782,6 +771,8 @@ NSString* const kOverscrollActionsDidEnd = @"OverscrollActionsDidStop";
} break; } break;
case OverscrollState::STARTED_PULLING: { case OverscrollState::STARTED_PULLING: {
if (!self.overscrollActionView.superview && self.scrollViewDragged) { if (!self.overscrollActionView.superview && self.scrollViewDragged) {
UIView* headerView = [self.delegate headerView];
DCHECK(headerView);
if (previousOverscrollState == OverscrollState::NO_PULL_STARTED) { if (previousOverscrollState == OverscrollState::NO_PULL_STARTED) {
UIView* view = [self.delegate toolbarSnapshotView]; UIView* view = [self.delegate toolbarSnapshotView];
[self.overscrollActionView addSnapshotView:view]; [self.overscrollActionView addSnapshotView:view];
...@@ -795,14 +786,7 @@ NSString* const kOverscrollActionsDidEnd = @"OverscrollActionsDidStop"; ...@@ -795,14 +786,7 @@ NSString* const kOverscrollActionsDidEnd = @"OverscrollActionsDidStop";
self.overscrollActionView.backgroundView.alpha = 1; self.overscrollActionView.backgroundView.alpha = 1;
[self.overscrollActionView updateWithVerticalOffset:0]; [self.overscrollActionView updateWithVerticalOffset:0];
[self.overscrollActionView updateWithHorizontalOffset:0]; [self.overscrollActionView updateWithHorizontalOffset:0];
self.overscrollActionView.frame = [self headerView].bounds; self.overscrollActionView.frame = headerView.bounds;
DCHECK([self headerView]);
UIView<RelaxedBoundsConstraintsHitTestSupport>* headerView =
[self headerView];
if ([headerView
respondsToSelector:@selector(
setHitTestBoundsContraintRelaxed:)])
[headerView setHitTestBoundsContraintRelaxed:YES];
[headerView addSubview:self.overscrollActionView]; [headerView addSubview:self.overscrollActionView];
[CATransaction commit]; [CATransaction commit];
} }
......
...@@ -64,7 +64,6 @@ source_set("util") { ...@@ -64,7 +64,6 @@ source_set("util") {
"pasteboard_util.mm", "pasteboard_util.mm",
"property_animator_group.h", "property_animator_group.h",
"property_animator_group.mm", "property_animator_group.mm",
"relaxed_bounds_constraints_hittest.h",
"reversed_animation.h", "reversed_animation.h",
"reversed_animation.mm", "reversed_animation.mm",
"rtl_geometry.h", "rtl_geometry.h",
......
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_UI_UTIL_RELAXED_BOUNDS_CONSTRAINTS_HITTEST_H_
#define IOS_CHROME_BROWSER_UI_UTIL_RELAXED_BOUNDS_CONSTRAINTS_HITTEST_H_
#import <Foundation/Foundation.h>
// This protocol is meant to be implemented by subclasses of UIView. It exposes
// a property |hitTestBoundsContraintRelaxed| that when set to YES, inform that
// bounds constraints on the hitTest: method shouldn't be taken into account.
// The implementer of that protocol must override the hitTest: method and check
// for that property.
@protocol RelaxedBoundsConstraintsHitTestSupport<NSObject>
@optional
@property(nonatomic, assign) BOOL hitTestBoundsContraintRelaxed;
@end
#endif // IOS_CHROME_BROWSER_UI_UTIL_RELAXED_BOUNDS_CONSTRAINTS_HITTEST_H_
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