| 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 CWVWebViewConfiguration; | 10 @class CWVWebViewConfiguration; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 // The current page title. | 47 // The current page title. |
| 48 @property(nonatomic, readonly, copy) NSString* title; | 48 @property(nonatomic, readonly, copy) NSString* title; |
| 49 | 49 |
| 50 // Page loading progress from 0.0 to 1.0. KVO compliant. | 50 // Page loading progress from 0.0 to 1.0. KVO compliant. |
| 51 // | 51 // |
| 52 // It is 0.0 initially before the first navigation starts. After a navigation | 52 // It is 0.0 initially before the first navigation starts. After a navigation |
| 53 // completes, it remains at 1.0 until a new navigation starts, at which point it | 53 // completes, it remains at 1.0 until a new navigation starts, at which point it |
| 54 // is reset to 0.0. | 54 // is reset to 0.0. |
| 55 @property(nonatomic, readonly) double estimatedProgress; | 55 @property(nonatomic, readonly) double estimatedProgress; |
| 56 | 56 |
| 57 // The User Agent product string used to build the full User Agent. |
| 58 + (NSString*)userAgentProduct; |
| 59 |
| 60 // Customizes the User Agent string by inserting |product|. It should be of the |
| 61 // format "product/1.0". For example: |
| 62 // "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/603.1.30 |
| 63 // (KHTML, like Gecko) <product> Mobile/16D32 Safari/602.1" where <product> |
| 64 // will be replaced with |product| or empty string if not set. |
| 65 // |
| 66 // NOTE: It is recommended to set |product| before initializing any web views. |
| 67 // Setting |product| is only guaranteed to affect web views which have not yet |
| 68 // been initialized. However, exisiting web views could also be affected |
| 69 // depending upon their internal state. |
| 70 + (void)setUserAgentProduct:(NSString*)product; |
| 71 |
| 57 // |configuration| must not be null | 72 // |configuration| must not be null |
| 58 - (instancetype)initWithFrame:(CGRect)frame | 73 - (instancetype)initWithFrame:(CGRect)frame |
| 59 configuration:(CWVWebViewConfiguration*)configuration | 74 configuration:(CWVWebViewConfiguration*)configuration |
| 60 NS_DESIGNATED_INITIALIZER; | 75 NS_DESIGNATED_INITIALIZER; |
| 61 | 76 |
| 62 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; | 77 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; |
| 63 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; | 78 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; |
| 64 | 79 |
| 65 // Navigates backwards or forwards by one page. Does nothing if the | 80 // Navigates backwards or forwards by one page. Does nothing if the |
| 66 // corresponding |canGoBack| or |canGoForward| method returns NO. | 81 // corresponding |canGoBack| or |canGoForward| method returns NO. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 78 - (void)loadRequest:(NSURLRequest*)request; | 93 - (void)loadRequest:(NSURLRequest*)request; |
| 79 | 94 |
| 80 // Evaluates a JavaScript string. | 95 // Evaluates a JavaScript string. |
| 81 // The completion handler is invoked when script evaluation completes. | 96 // The completion handler is invoked when script evaluation completes. |
| 82 - (void)evaluateJavaScript:(NSString*)javaScriptString | 97 - (void)evaluateJavaScript:(NSString*)javaScriptString |
| 83 completionHandler:(void (^)(id, NSError*))completionHandler; | 98 completionHandler:(void (^)(id, NSError*))completionHandler; |
| 84 | 99 |
| 85 @end | 100 @end |
| 86 | 101 |
| 87 #endif // IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_H_ | 102 #endif // IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_H_ |
| OLD | NEW |