Commit 7d75ae11 authored by Hiroshi Ichikawa's avatar Hiroshi Ichikawa Committed by Commit Bot

Delete simple method delegation code in CRWWebViewScrollViewProxy.

These are no longer necessary because undefined methods are delegated to
self.underlyingScrollView by default with -forwardInvocation:.

And it makes easier to preserve properties using CRWPropertiesStore by
deleting them.

Bug: 1023250
Change-Id: I3ad9fc7ccc919086dd57a019a721461736fa21f0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2006843Reviewed-by: default avatarKurt Horimoto <kkhorimoto@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Hiroshi Ichikawa <ichikawa@chromium.org>
Cr-Commit-Position: refs/heads/master@{#733894}
parent f3194828
......@@ -32,7 +32,7 @@ namespace {
class TestWebStateWithProxy : public web::TestWebState {
public:
TestWebStateWithProxy() {
scroll_view_proxy_ = OCMClassMock([CRWWebViewScrollViewProxy class]);
scroll_view_proxy_ = [[CRWWebViewScrollViewProxy alloc] init];
id web_view_proxy_mock = OCMProtocolMock(@protocol(CRWWebViewProxy));
[[[web_view_proxy_mock stub] andReturn:scroll_view_proxy_] scrollViewProxy];
web_view_proxy_ = web_view_proxy_mock;
......
......@@ -23,6 +23,8 @@
// TODO(crbug.com/546152): rename class to CRWContentViewScrollViewProxy.
@interface CRWWebViewScrollViewProxy : NSObject
@property(nonatomic, readonly, copy) NSArray<__kindof UIView*>* subviews;
// Used by the CRWWebViewProxy to set the UIScrollView to be managed.
- (void)setScrollView:(UIScrollView*)scrollView;
......@@ -71,7 +73,6 @@
UIPanGestureRecognizer* panGestureRecognizer;
// Returns the scrollview's gesture recognizers.
@property(weak, nonatomic, readonly) NSArray* gestureRecognizers;
@property(nonatomic, readonly, copy) NSArray<__kindof UIView*>* subviews;
- (void)addGestureRecognizer:(UIGestureRecognizer*)gestureRecognizer;
- (void)removeGestureRecognizer:(UIGestureRecognizer*)gestureRecognizer;
......
......@@ -173,14 +173,6 @@
[self stopObservingScrollView:self.underlyingScrollView];
}
- (void)addGestureRecognizer:(UIGestureRecognizer*)gestureRecognizer {
[self.underlyingScrollView addGestureRecognizer:gestureRecognizer];
}
- (void)removeGestureRecognizer:(UIGestureRecognizer*)gestureRecognizer {
[self.underlyingScrollView removeGestureRecognizer:gestureRecognizer];
}
- (void)addObserver:(id<CRWWebViewScrollViewProxyObserver>)observer {
[_observers addObserver:observer];
}
......@@ -232,27 +224,6 @@
[_observers webViewScrollViewProxyDidSetScrollView:self];
}
- (CGRect)frame {
return self.underlyingScrollView ? [self.underlyingScrollView frame]
: CGRectZero;
}
- (BOOL)isScrollEnabled {
return [self.underlyingScrollView isScrollEnabled];
}
- (void)setScrollEnabled:(BOOL)scrollEnabled {
[self.underlyingScrollView setScrollEnabled:scrollEnabled];
}
- (BOOL)bounces {
return [self.underlyingScrollView bounces];
}
- (void)setBounces:(BOOL)bounces {
[self.underlyingScrollView setBounces:bounces];
}
- (BOOL)clipsToBounds {
if (!self.underlyingScrollView && _storedClipsToBounds) {
return *_storedClipsToBounds;
......@@ -265,75 +236,6 @@
self.underlyingScrollView.clipsToBounds = clipsToBounds;
}
- (BOOL)isDecelerating {
return [self.underlyingScrollView isDecelerating];
}
- (BOOL)isDragging {
return [self.underlyingScrollView isDragging];
}
- (BOOL)isTracking {
return [self.underlyingScrollView isTracking];
}
- (BOOL)isZooming {
return [self.underlyingScrollView isZooming];
}
- (CGFloat)zoomScale {
return [self.underlyingScrollView zoomScale];
}
- (void)setContentOffset:(CGPoint)contentOffset {
[self.underlyingScrollView setContentOffset:contentOffset];
}
- (CGPoint)contentOffset {
return self.underlyingScrollView ? [self.underlyingScrollView contentOffset]
: CGPointZero;
}
- (void)setContentInset:(UIEdgeInsets)contentInset {
[self.underlyingScrollView setContentInset:contentInset];
}
- (UIEdgeInsets)contentInset {
return self.underlyingScrollView ? [self.underlyingScrollView contentInset]
: UIEdgeInsetsZero;
}
- (void)setScrollIndicatorInsets:(UIEdgeInsets)scrollIndicatorInsets {
[self.underlyingScrollView setScrollIndicatorInsets:scrollIndicatorInsets];
}
- (UIEdgeInsets)scrollIndicatorInsets {
return self.underlyingScrollView
? [self.underlyingScrollView scrollIndicatorInsets]
: UIEdgeInsetsZero;
}
- (void)setContentSize:(CGSize)contentSize {
[self.underlyingScrollView setContentSize:contentSize];
}
- (CGSize)contentSize {
return self.underlyingScrollView ? [self.underlyingScrollView contentSize]
: CGSizeZero;
}
- (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated {
[self.underlyingScrollView setContentOffset:contentOffset animated:animated];
}
- (BOOL)scrollsToTop {
return [self.underlyingScrollView scrollsToTop];
}
- (void)setScrollsToTop:(BOOL)scrollsToTop {
[self.underlyingScrollView setScrollsToTop:scrollsToTop];
}
- (UIScrollViewContentInsetAdjustmentBehavior)contentInsetAdjustmentBehavior
API_AVAILABLE(ios(11.0)) {
if (self.underlyingScrollView) {
......@@ -345,10 +247,6 @@
}
}
- (UIEdgeInsets)adjustedContentInset API_AVAILABLE(ios(11.0)) {
return [self.underlyingScrollView adjustedContentInset];
}
- (void)setContentInsetAdjustmentBehavior:
(UIScrollViewContentInsetAdjustmentBehavior)contentInsetAdjustmentBehavior
API_AVAILABLE(ios(11.0)) {
......@@ -359,14 +257,6 @@
contentInsetAdjustmentBehavior);
}
- (UIPanGestureRecognizer*)panGestureRecognizer {
return [self.underlyingScrollView panGestureRecognizer];
}
- (NSArray*)gestureRecognizers {
return [self.underlyingScrollView gestureRecognizers];
}
- (NSArray<__kindof UIView*>*)subviews {
return self.underlyingScrollView ? [self.underlyingScrollView subviews] : @[];
}
......
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