| 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 CWVWebViewConfiguration; | 11 @class CWVWebViewConfiguration; |
| 11 @protocol CWVUIDelegate; | 12 @protocol CWVUIDelegate; |
| 12 @protocol CWVTranslateDelegate; | 13 @protocol CWVTranslateDelegate; |
| 13 @protocol CWVNavigationDelegate; | 14 @protocol CWVNavigationDelegate; |
| 14 | 15 |
| 15 // 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 |
| 16 // implementation. | 17 // implementation. |
| 17 // | 18 // |
| 18 // In addition to WKWebView features, it allows Translate, Find In Page, | 19 // In addition to WKWebView features, it allows Translate, Find In Page, |
| 19 // Customizable Context Menus, and maybe more. | 20 // Customizable Context Menus, and maybe more. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 50 // The current page title. | 51 // The current page title. |
| 51 @property(nonatomic, readonly, copy) NSString* title; | 52 @property(nonatomic, readonly, copy) NSString* title; |
| 52 | 53 |
| 53 // Page loading progress from 0.0 to 1.0. KVO compliant. | 54 // Page loading progress from 0.0 to 1.0. KVO compliant. |
| 54 // | 55 // |
| 55 // It is 0.0 initially before the first navigation starts. After a navigation | 56 // It is 0.0 initially before the first navigation starts. After a navigation |
| 56 // completes, it remains at 1.0 until a new navigation starts, at which point it | 57 // completes, it remains at 1.0 until a new navigation starts, at which point it |
| 57 // is reset to 0.0. | 58 // is reset to 0.0. |
| 58 @property(nonatomic, readonly) double estimatedProgress; | 59 @property(nonatomic, readonly) double estimatedProgress; |
| 59 | 60 |
| 61 // The scroll view associated with the web view. |
| 62 @property(nonatomic, readonly) CWVScrollView* scrollView; |
| 63 |
| 60 // The User Agent product string used to build the full User Agent. | 64 // The User Agent product string used to build the full User Agent. |
| 61 + (NSString*)userAgentProduct; | 65 + (NSString*)userAgentProduct; |
| 62 | 66 |
| 63 // Customizes the User Agent string by inserting |product|. It should be of the | 67 // Customizes the User Agent string by inserting |product|. It should be of the |
| 64 // format "product/1.0". For example: | 68 // format "product/1.0". For example: |
| 65 // "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/603.1.30 | 69 // "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/603.1.30 |
| 66 // (KHTML, like Gecko) <product> Mobile/16D32 Safari/602.1" where <product> | 70 // (KHTML, like Gecko) <product> Mobile/16D32 Safari/602.1" where <product> |
| 67 // will be replaced with |product| or empty string if not set. | 71 // will be replaced with |product| or empty string if not set. |
| 68 // | 72 // |
| 69 // NOTE: It is recommended to set |product| before initializing any web views. | 73 // NOTE: It is recommended to set |product| before initializing any web views. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 - (void)loadRequest:(NSURLRequest*)request; | 109 - (void)loadRequest:(NSURLRequest*)request; |
| 106 | 110 |
| 107 // Evaluates a JavaScript string. | 111 // Evaluates a JavaScript string. |
| 108 // The completion handler is invoked when script evaluation completes. | 112 // The completion handler is invoked when script evaluation completes. |
| 109 - (void)evaluateJavaScript:(NSString*)javaScriptString | 113 - (void)evaluateJavaScript:(NSString*)javaScriptString |
| 110 completionHandler:(void (^)(id, NSError*))completionHandler; | 114 completionHandler:(void (^)(id, NSError*))completionHandler; |
| 111 | 115 |
| 112 @end | 116 @end |
| 113 | 117 |
| 114 #endif // IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_H_ | 118 #endif // IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_H_ |
| OLD | NEW |