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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/603.1.30 | 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> | 63 // (KHTML, like Gecko) <product> Mobile/16D32 Safari/602.1" where <product> |
64 // will be replaced with |product| or empty string if not set. | 64 // will be replaced with |product| or empty string if not set. |
65 // | 65 // |
66 // NOTE: It is recommended to set |product| before initializing any web views. | 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 | 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 | 68 // been initialized. However, exisiting web views could also be affected |
69 // depending upon their internal state. | 69 // depending upon their internal state. |
70 + (void)setUserAgentProduct:(NSString*)product; | 70 + (void)setUserAgentProduct:(NSString*)product; |
71 | 71 |
| 72 // Use this method to set the necessary credentials used to communicate with |
| 73 // the Google API for features such as translate. See this link for more info: |
| 74 // https://support.google.com/googleapi/answer/6158857 |
| 75 // This method must be called before any |CWVWebViews| are instantiated for |
| 76 // the keys to be used. |
| 77 + (void)setGoogleAPIKey:(NSString*)googleAPIKey |
| 78 clientID:(NSString*)clientID |
| 79 clientSecret:(NSString*)clientSecret; |
| 80 |
72 // |configuration| must not be null | 81 // |configuration| must not be null |
73 - (instancetype)initWithFrame:(CGRect)frame | 82 - (instancetype)initWithFrame:(CGRect)frame |
74 configuration:(CWVWebViewConfiguration*)configuration | 83 configuration:(CWVWebViewConfiguration*)configuration |
75 NS_DESIGNATED_INITIALIZER; | 84 NS_DESIGNATED_INITIALIZER; |
76 | 85 |
77 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; | 86 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; |
78 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; | 87 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; |
79 | 88 |
80 // Navigates backwards or forwards by one page. Does nothing if the | 89 // Navigates backwards or forwards by one page. Does nothing if the |
81 // corresponding |canGoBack| or |canGoForward| method returns NO. | 90 // corresponding |canGoBack| or |canGoForward| method returns NO. |
(...skipping 11 matching lines...) Expand all Loading... |
93 - (void)loadRequest:(NSURLRequest*)request; | 102 - (void)loadRequest:(NSURLRequest*)request; |
94 | 103 |
95 // Evaluates a JavaScript string. | 104 // Evaluates a JavaScript string. |
96 // The completion handler is invoked when script evaluation completes. | 105 // The completion handler is invoked when script evaluation completes. |
97 - (void)evaluateJavaScript:(NSString*)javaScriptString | 106 - (void)evaluateJavaScript:(NSString*)javaScriptString |
98 completionHandler:(void (^)(id, NSError*))completionHandler; | 107 completionHandler:(void (^)(id, NSError*))completionHandler; |
99 | 108 |
100 @end | 109 @end |
101 | 110 |
102 #endif // IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_H_ | 111 #endif // IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_H_ |
OLD | NEW |