| 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 <UIKit/UIKit.h> | 7 #import <UIKit/UIKit.h> |
| 8 | 8 |
| 9 // TODO(crbug.com/704946): Make framework style include work everywhere and | 9 // TODO(crbug.com/704946): Make framework style include work everywhere and |
| 10 // remove this #if. | 10 // remove this #if. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // The current page title. | 54 // The current page title. |
| 55 @property(nonatomic, readonly, copy) NSString* title; | 55 @property(nonatomic, readonly, copy) NSString* title; |
| 56 | 56 |
| 57 // Page loading progress from 0.0 to 1.0. KVO compliant. | 57 // Page loading progress from 0.0 to 1.0. KVO compliant. |
| 58 // | 58 // |
| 59 // It is 0.0 initially before the first navigation starts. After a navigation | 59 // It is 0.0 initially before the first navigation starts. After a navigation |
| 60 // completes, it remains at 1.0 until a new navigation starts, at which point it | 60 // completes, it remains at 1.0 until a new navigation starts, at which point it |
| 61 // is reset to 0.0. | 61 // is reset to 0.0. |
| 62 @property(nonatomic, readonly) double estimatedProgress; | 62 @property(nonatomic, readonly) double estimatedProgress; |
| 63 | 63 |
| 64 // Use this method to set the necessary credentials used to communicate with |
| 65 // the Google API for features such as translate. See this link for more info: |
| 66 // https://support.google.com/googleapi/answer/6158857 |
| 67 // This method must be called before any |CWVWebViews| are instantiated for |
| 68 // the keys to be used. |
| 69 + (void)setGoogleAPIKey:(NSString*)googleAPIKey |
| 70 clientID:(NSString*)clientID |
| 71 clientSecret:(NSString*)clientSecret; |
| 72 |
| 64 // |configuration| must not be null | 73 // |configuration| must not be null |
| 65 - (instancetype)initWithFrame:(CGRect)frame | 74 - (instancetype)initWithFrame:(CGRect)frame |
| 66 configuration:(CWVWebViewConfiguration*)configuration | 75 configuration:(CWVWebViewConfiguration*)configuration |
| 67 NS_DESIGNATED_INITIALIZER; | 76 NS_DESIGNATED_INITIALIZER; |
| 68 | 77 |
| 69 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; | 78 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; |
| 70 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; | 79 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; |
| 71 | 80 |
| 72 // Navigates backwards or forwards by one page. Does nothing if the | 81 // Navigates backwards or forwards by one page. Does nothing if the |
| 73 // corresponding |canGoBack| or |canGoForward| method returns NO. | 82 // corresponding |canGoBack| or |canGoForward| method returns NO. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 85 - (void)loadRequest:(NSURLRequest*)request; | 94 - (void)loadRequest:(NSURLRequest*)request; |
| 86 | 95 |
| 87 // Evaluates a JavaScript string. | 96 // Evaluates a JavaScript string. |
| 88 // The completion handler is invoked when script evaluation completes. | 97 // The completion handler is invoked when script evaluation completes. |
| 89 - (void)evaluateJavaScript:(NSString*)javaScriptString | 98 - (void)evaluateJavaScript:(NSString*)javaScriptString |
| 90 completionHandler:(void (^)(id, NSError*))completionHandler; | 99 completionHandler:(void (^)(id, NSError*))completionHandler; |
| 91 | 100 |
| 92 @end | 101 @end |
| 93 | 102 |
| 94 #endif // IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_H_ | 103 #endif // IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_H_ |
| OLD | NEW |