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

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

Issue 2842953002: Implement CWVWebView.scrollView. (Closed)
Patch Set: Revert unintended change. Created 3 years, 8 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
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..72fda91e28e1475fe69bf8a9707ed77e7eceb0e8
--- /dev/null
+++ b/ios/web_view/public/cwv_scroll_view.h
@@ -0,0 +1,42 @@
+// 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. Has subset of methods of
+// UIScrollView. This is not a subclass of UIScrollView because
+// we don't want to expose the raw scroll view.
Eugene But (OOO till 7-30) 2017/04/26 19:11:31 Please avoid using "we" in the comments (go/avoidw
Hiroshi Ichikawa 2017/04/27 02:30:11 Done.
+//
+// See the document of UIScrollView for the document of each
+// method.
+//
+// TODO: Add nullability annotations.
+CWV_EXPORT
+@interface CWVScrollView : NSObject
+
+@property(nonatomic, readonly) CGRect frame;
+@property(nonatomic, readonly) CGRect bounds;
+@property(nonatomic) CGPoint contentOffset;
+@property(nonatomic, readonly) CGSize contentSize;
+@property(nonatomic, weak) id<CWVScrollViewDelegate> delegate;
+@property(nonatomic, readonly, getter=isDragging) BOOL dragging;
+- (void)addGestureRecognizer:(UIGestureRecognizer*)gestureRecognizer;
+
+// Be careful when using this property. There's a bug with the
+// underlying WKWebView where the web view does not respect
+// contentInsets properly. See:
+// https://chromereviews.googleplex.com/323287014/
Eugene But (OOO till 7-30) 2017/04/26 19:11:31 Please link rdar://23584409 instead of internal go
Hiroshi Ichikawa 2017/04/27 02:30:11 Looks like the issue is not visible at Open Radar?
Eugene But (OOO till 7-30) 2017/04/27 12:25:23 In Chromium we do not use links to internal google
Hiroshi Ichikawa 2017/04/28 01:30:47 Oh I assumed that all Chromium code review URLs ar
Eugene But (OOO till 7-30) 2017/04/28 02:44:20 Yes
+@property(nonatomic) UIEdgeInsets contentInset;
+
+@end
+
+#endif // IOS_WEB_VIEW_PUBLIC_CWV_SCROLL_VIEW_H_

Powered by Google App Engine
This is Rietveld 408576698