Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(542)

Unified Diff: ios/web_view/public/cwv_scroll_view.h

Issue 2842953002: Implement CWVWebView.scrollView. (Closed)
Patch Set: Apply review comments. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web_view/public/ChromeWebView.h ('k') | ios/web_view/public/cwv_scroll_view_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « ios/web_view/public/ChromeWebView.h ('k') | ios/web_view/public/cwv_scroll_view_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698