Index: ios/web_view/public/cwv_scroll_view.h |
diff --git a/ios/web_view/public/cwv_scroll_view.h b/ios/web_view/public/cwv_scroll_view.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4b5c268fdf99371e6a26ba19a6e0ca88a451525d |
--- /dev/null |
+++ b/ios/web_view/public/cwv_scroll_view.h |
@@ -0,0 +1,47 @@ |
+// Copyright 2017 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_WEB_VIEW_PUBLIC_CWV_SCROLL_VIEW_H_ |
+#define IOS_WEB_VIEW_PUBLIC_CWV_SCROLL_VIEW_H_ |
+ |
+#import <ChromeWebView/cwv_export.h> |
+#import <CoreGraphics/CoreGraphics.h> |
+#import <Foundation/Foundation.h> |
+#import <UIKit/UIKit.h> |
+ |
+@protocol CWVScrollViewDelegate; |
+ |
+// Scroll view inside the web view. This is not a subclass of UIScrollView |
+// because the underlying //ios/web API only exposes a proxy object of the |
+// scroll view, not the raw UIScrollView. |
+// |
+// These methods are forwarded to the internal UIScrollView. Please see the |
+// <UIKit/UIScrollView.h> documentation for details about the following methods. |
+// |
+// TODO(crbug.com/719323): Add nullability annotations. |
+CWV_EXPORT |
+@interface CWVScrollView : NSObject |
+ |
+@property(nonatomic, readonly) CGRect bounds; |
+@property(nonatomic) CGPoint contentOffset; |
+@property(nonatomic, weak) id<CWVScrollViewDelegate> delegate; |
+@property(nonatomic, readonly, getter=isDragging) BOOL dragging; |
+ |
+// KVO compliant. |
+@property(nonatomic, readonly) CGSize contentSize; |
+ |
+// Be careful when using this property. There's a bug with the |
+// underlying WKWebView where the web view does not respect contentInsets |
+// properly when laying out content and calculating innerHeight for Javascript. |
+// Content is laid out based on the entire height of the web view rather than |
+// the height between the top and bottom insets. |
+// https://bugs.webkit.org/show_bug.cgi?id=134230 |
+// rdar://23584409 (not available on Open Radar) |
+@property(nonatomic) UIEdgeInsets contentInset; |
+ |
+- (void)addGestureRecognizer:(UIGestureRecognizer*)gestureRecognizer; |
+ |
+@end |
+ |
+#endif // IOS_WEB_VIEW_PUBLIC_CWV_SCROLL_VIEW_H_ |