| 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 <ChromeWebView/cwv_export.h> | 7 #import <ChromeWebView/cwv_export.h> |
| 8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
| 9 | 9 |
| 10 @class CWVScrollView; | 10 @class CWVScrollView; |
| 11 @class CWVTranslationController; |
| 11 @class CWVWebViewConfiguration; | 12 @class CWVWebViewConfiguration; |
| 12 @protocol CWVUIDelegate; | 13 @protocol CWVUIDelegate; |
| 13 @protocol CWVTranslateDelegate; | |
| 14 @protocol CWVNavigationDelegate; | 14 @protocol CWVNavigationDelegate; |
| 15 | 15 |
| 16 // A web view component (like WKWebView) which uses iOS Chromium's web view | 16 // A web view component (like WKWebView) which uses iOS Chromium's web view |
| 17 // implementation. | 17 // implementation. |
| 18 // | 18 // |
| 19 // In addition to WKWebView features, it allows Translate, Find In Page, | 19 // In addition to WKWebView features, it allows Translate, Find In Page, |
| 20 // Customizable Context Menus, and maybe more. | 20 // Customizable Context Menus, and maybe more. |
| 21 // | 21 // |
| 22 // Concrete instances can be created through CWV. | 22 // Concrete instances can be created through CWV. |
| 23 CWV_EXPORT | 23 CWV_EXPORT |
| 24 @interface CWVWebView : UIView | 24 @interface CWVWebView : UIView |
| 25 | 25 |
| 26 // The configuration of the web view. | 26 // The configuration of the web view. |
| 27 @property(nonatomic, readonly, copy) CWVWebViewConfiguration* configuration; | 27 @property(nonatomic, readonly, copy) CWVWebViewConfiguration* configuration; |
| 28 | 28 |
| 29 // This web view's navigation delegate. | 29 // This web view's navigation delegate. |
| 30 @property(nonatomic, weak) id<CWVNavigationDelegate> navigationDelegate; | 30 @property(nonatomic, weak) id<CWVNavigationDelegate> navigationDelegate; |
| 31 | 31 |
| 32 // This web view's translation controller. |
| 33 @property(nonatomic, readonly) CWVTranslationController* translationController; |
| 34 |
| 32 // This web view's UI delegate | 35 // This web view's UI delegate |
| 33 @property(nonatomic, weak) id<CWVUIDelegate> UIDelegate; | 36 @property(nonatomic, weak) id<CWVUIDelegate> UIDelegate; |
| 34 | 37 |
| 35 // A delegate for the translation feature. | |
| 36 @property(nonatomic, weak) id<CWVTranslateDelegate> translationDelegate; | |
| 37 | |
| 38 // Whether or not this web view can go backwards or forwards. | 38 // Whether or not this web view can go backwards or forwards. |
| 39 @property(nonatomic, readonly) BOOL canGoBack; | 39 @property(nonatomic, readonly) BOOL canGoBack; |
| 40 @property(nonatomic, readonly) BOOL canGoForward; | 40 @property(nonatomic, readonly) BOOL canGoForward; |
| 41 | 41 |
| 42 // Whether or not this web view is loading a page. | 42 // Whether or not this web view is loading a page. |
| 43 @property(nonatomic, readonly) BOOL isLoading; | 43 @property(nonatomic, readonly) BOOL isLoading; |
| 44 | 44 |
| 45 // The URL displayed in the url bar. | 45 // The URL displayed in the url bar. |
| 46 @property(nonatomic, readonly) NSURL* visibleURL; | 46 @property(nonatomic, readonly) NSURL* visibleURL; |
| 47 | 47 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 - (void)loadRequest:(NSURLRequest*)request; | 109 - (void)loadRequest:(NSURLRequest*)request; |
| 110 | 110 |
| 111 // Evaluates a JavaScript string. | 111 // Evaluates a JavaScript string. |
| 112 // The completion handler is invoked when script evaluation completes. | 112 // The completion handler is invoked when script evaluation completes. |
| 113 - (void)evaluateJavaScript:(NSString*)javaScriptString | 113 - (void)evaluateJavaScript:(NSString*)javaScriptString |
| 114 completionHandler:(void (^)(id, NSError*))completionHandler; | 114 completionHandler:(void (^)(id, NSError*))completionHandler; |
| 115 | 115 |
| 116 @end | 116 @end |
| 117 | 117 |
| 118 #endif // IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_H_ | 118 #endif // IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_H_ |
| OLD | NEW |