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 <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 // Customizes the User Agent string. It should be of the format "product/1.0". | |
| 58 // NOTE: It is recommended to set |product| before initializing any web views. | |
| 59 // | |
| 60 // Setting |product| is only guaranteed to affect web views which have not yet | |
| 61 // been initialized. However, exisiting web views could also be affected | |
| 62 // depending upon their internal state. | |
| 63 + (void)setUserAgentProduct:(NSString*)product; | |
|
Eugene But (OOO till 7-30)
2017/04/08 00:34:36
Should this be setUserAgent to allow better flexib
michaeldo
2017/04/11 17:07:48
Per offline discussion, setUserAgentProduct should
| |
| 64 | |
| 57 // |configuration| must not be null | 65 // |configuration| must not be null |
| 58 - (instancetype)initWithFrame:(CGRect)frame | 66 - (instancetype)initWithFrame:(CGRect)frame |
| 59 configuration:(CWVWebViewConfiguration*)configuration | 67 configuration:(CWVWebViewConfiguration*)configuration |
| 60 NS_DESIGNATED_INITIALIZER; | 68 NS_DESIGNATED_INITIALIZER; |
| 61 | 69 |
| 62 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; | 70 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; |
| 63 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; | 71 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; |
| 64 | 72 |
| 65 // Navigates backwards or forwards by one page. Does nothing if the | 73 // Navigates backwards or forwards by one page. Does nothing if the |
| 66 // corresponding |canGoBack| or |canGoForward| method returns NO. | 74 // corresponding |canGoBack| or |canGoForward| method returns NO. |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 78 - (void)loadRequest:(NSURLRequest*)request; | 86 - (void)loadRequest:(NSURLRequest*)request; |
| 79 | 87 |
| 80 // Evaluates a JavaScript string. | 88 // Evaluates a JavaScript string. |
| 81 // The completion handler is invoked when script evaluation completes. | 89 // The completion handler is invoked when script evaluation completes. |
| 82 - (void)evaluateJavaScript:(NSString*)javaScriptString | 90 - (void)evaluateJavaScript:(NSString*)javaScriptString |
| 83 completionHandler:(void (^)(id, NSError*))completionHandler; | 91 completionHandler:(void (^)(id, NSError*))completionHandler; |
| 84 | 92 |
| 85 @end | 93 @end |
| 86 | 94 |
| 87 #endif // IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_H_ | 95 #endif // IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_H_ |
| OLD | NEW |