Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 #ifndef IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_H_ | 4 #ifndef IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_H_ |
| 5 #define IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_H_ | 5 #define IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_H_ |
| 6 | 6 |
| 7 #import <UIKit/UIKit.h> | 7 #import <UIKit/UIKit.h> |
| 8 | 8 |
| 9 @class CWVWebViewConfiguration; | 9 @class CWVWebViewConfiguration; |
| 10 @protocol CWVUIDelegate; | |
| 10 @protocol CWVWebViewDelegate; | 11 @protocol CWVWebViewDelegate; |
| 11 | 12 |
| 12 // A web view component (like WKWebView) which uses iOS Chromium's web view | 13 // A web view component (like WKWebView) which uses iOS Chromium's web view |
| 13 // implementation. | 14 // implementation. |
| 14 // | 15 // |
| 15 // In addition to WKWebView features, it allows Translate, Find In Page, | 16 // In addition to WKWebView features, it allows Translate, Find In Page, |
| 16 // Customizable Context Menus, and maybe more. | 17 // Customizable Context Menus, and maybe more. |
| 17 // | 18 // |
| 18 // Concrete instances can be created through CWV. | 19 // Concrete instances can be created through CWV. |
| 19 @interface CWVWebView : UIView | 20 @interface CWVWebView : UIView |
| 20 | 21 |
| 21 // The view used to display web content. | 22 // The view used to display web content. |
| 22 @property(nonatomic, readonly) UIView* view; | 23 @property(nonatomic, readonly) UIView* view; |
| 23 | 24 |
| 24 // This web view's delegate. | 25 // This web view's delegate. |
| 25 @property(nonatomic, weak) id<CWVWebViewDelegate> delegate; | 26 @property(nonatomic, weak) id<CWVWebViewDelegate> delegate; |
| 26 | 27 |
| 28 // This web view's UI delegate | |
| 29 @property(nonatomic, weak) id<CWVUIDelegate> UIDelegate; | |
|
Eugene But (OOO till 7-30)
2017/02/27 16:34:07
Feedback for a separate CL: we should probably use
michaeldo
2017/02/27 19:02:06
Agreed, I filed crbug.com/696661
| |
| 30 | |
| 27 // Whether or not this web view can go backwards or forwards. | 31 // Whether or not this web view can go backwards or forwards. |
| 28 @property(nonatomic, readonly) BOOL canGoBack; | 32 @property(nonatomic, readonly) BOOL canGoBack; |
| 29 @property(nonatomic, readonly) BOOL canGoForward; | 33 @property(nonatomic, readonly) BOOL canGoForward; |
| 30 | 34 |
| 31 // Whether or not this web view is loading a page. | 35 // Whether or not this web view is loading a page. |
| 32 @property(nonatomic, readonly) BOOL isLoading; | 36 @property(nonatomic, readonly) BOOL isLoading; |
| 33 | 37 |
| 34 // The current URL, for display to the user. | 38 // The current URL, for display to the user. |
| 35 @property(nonatomic, readonly) NSURL* visibleURL; | 39 @property(nonatomic, readonly) NSURL* visibleURL; |
| 36 | 40 |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 65 - (void)loadRequest:(NSURLRequest*)request; | 69 - (void)loadRequest:(NSURLRequest*)request; |
| 66 | 70 |
| 67 // Evaluates a JavaScript string. | 71 // Evaluates a JavaScript string. |
| 68 // The completion handler is invoked when script evaluation completes. | 72 // The completion handler is invoked when script evaluation completes. |
| 69 - (void)evaluateJavaScript:(NSString*)javaScriptString | 73 - (void)evaluateJavaScript:(NSString*)javaScriptString |
| 70 completionHandler:(void (^)(id, NSError*))completionHandler; | 74 completionHandler:(void (^)(id, NSError*))completionHandler; |
| 71 | 75 |
| 72 @end | 76 @end |
| 73 | 77 |
| 74 #endif // IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_H_ | 78 #endif // IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_H_ |
| OLD | NEW |