| 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_CRIWV_WEB_VIEW_H_ | 4 #ifndef IOS_WEB_VIEW_PUBLIC_CRIWV_WEB_VIEW_H_ |
| 5 #define IOS_WEB_VIEW_PUBLIC_CRIWV_WEB_VIEW_H_ | 5 #define IOS_WEB_VIEW_PUBLIC_CRIWV_WEB_VIEW_H_ |
| 6 | 6 |
| 7 #import <UIKit/UIKit.h> | 7 #import <UIKit/UIKit.h> |
| 8 | 8 |
| 9 @class CRIWVWebViewConfiguration; |
| 9 @protocol CRIWVWebViewDelegate; | 10 @protocol CRIWVWebViewDelegate; |
| 10 | 11 |
| 11 // A web view component (like WKWebView) which uses iOS Chromium's web view | 12 // A web view component (like WKWebView) which uses iOS Chromium's web view |
| 12 // implementation. | 13 // implementation. |
| 13 // | 14 // |
| 14 // In addition to WKWebView features, it allows Translate, Find In Page, | 15 // In addition to WKWebView features, it allows Translate, Find In Page, |
| 15 // Customizable Context Menus, and maybe more. | 16 // Customizable Context Menus, and maybe more. |
| 16 // | 17 // |
| 17 // Concrete instances can be created through CRIWV. | 18 // Concrete instances can be created through CRIWV. |
| 18 @interface CRIWVWebView : UIView | 19 @interface CRIWVWebView : UIView |
| (...skipping 14 matching lines...) Expand all Loading... |
| 33 // The current URL, for display to the user. | 34 // The current URL, for display to the user. |
| 34 @property(nonatomic, readonly) NSURL* visibleURL; | 35 @property(nonatomic, readonly) NSURL* visibleURL; |
| 35 | 36 |
| 36 // The current page title. | 37 // The current page title. |
| 37 @property(nonatomic, readonly) NSString* pageTitle; | 38 @property(nonatomic, readonly) NSString* pageTitle; |
| 38 | 39 |
| 39 // The current load progress, as a fraction between 0 and 1. This value is | 40 // The current load progress, as a fraction between 0 and 1. This value is |
| 40 // undefined if the web view is not currently loading. | 41 // undefined if the web view is not currently loading. |
| 41 @property(nonatomic, readonly) CGFloat loadProgress; | 42 @property(nonatomic, readonly) CGFloat loadProgress; |
| 42 | 43 |
| 44 // |configuration| must not be null |
| 45 - (instancetype)initWithFrame:(CGRect)frame |
| 46 configuration:(CRIWVWebViewConfiguration*)configuration |
| 47 NS_DESIGNATED_INITIALIZER; |
| 48 |
| 43 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; | 49 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; |
| 44 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; | 50 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; |
| 45 | 51 |
| 46 // Navigates backwards or forwards by one page. Does nothing if the | 52 // Navigates backwards or forwards by one page. Does nothing if the |
| 47 // corresponding |canGoBack| or |canGoForward| method returns NO. | 53 // corresponding |canGoBack| or |canGoForward| method returns NO. |
| 48 - (void)goBack; | 54 - (void)goBack; |
| 49 - (void)goForward; | 55 - (void)goForward; |
| 50 | 56 |
| 51 // Reloads the current page. | 57 // Reloads the current page. |
| 52 - (void)reload; | 58 - (void)reload; |
| 53 | 59 |
| 54 // Stops loading the current page. | 60 // Stops loading the current page. |
| 55 - (void)stopLoading; | 61 - (void)stopLoading; |
| 56 | 62 |
| 57 // Loads the given URL request in this web view. | 63 // Loads the given URL request in this web view. |
| 58 // Unlike WKWebView, this method supports HTTPBody. | 64 // Unlike WKWebView, this method supports HTTPBody. |
| 59 - (void)loadRequest:(NSURLRequest*)request; | 65 - (void)loadRequest:(NSURLRequest*)request; |
| 60 | 66 |
| 61 // Evaluates a JavaScript string. | 67 // Evaluates a JavaScript string. |
| 62 // The completion handler is invoked when script evaluation completes. | 68 // The completion handler is invoked when script evaluation completes. |
| 63 - (void)evaluateJavaScript:(NSString*)javaScriptString | 69 - (void)evaluateJavaScript:(NSString*)javaScriptString |
| 64 completionHandler:(void (^)(id, NSError*))completionHandler; | 70 completionHandler:(void (^)(id, NSError*))completionHandler; |
| 65 | 71 |
| 66 @end | 72 @end |
| 67 | 73 |
| 68 #endif // IOS_WEB_VIEW_PUBLIC_CRIWV_WEB_VIEW_H_ | 74 #endif // IOS_WEB_VIEW_PUBLIC_CRIWV_WEB_VIEW_H_ |
| OLD | NEW |