Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(930)

Side by Side Diff: ios/web_view/public/cwv_web_view.h

Issue 2839093002: Implemented new Translate API for purely Objective-C clients. (Closed)
Patch Set: addressed final comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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;
11 @class CWVTranslationController;
michaeldo 2017/05/01 18:25:38 Please move up to sort alphabetically.
jzw1 2017/05/08 03:36:28 Done.
11 @protocol CWVUIDelegate; 12 @protocol CWVUIDelegate;
12 @protocol CWVTranslateDelegate;
13 @protocol CWVNavigationDelegate; 13 @protocol CWVNavigationDelegate;
14 14
15 // A web view component (like WKWebView) which uses iOS Chromium's web view 15 // A web view component (like WKWebView) which uses iOS Chromium's web view
16 // implementation. 16 // implementation.
17 // 17 //
18 // In addition to WKWebView features, it allows Translate, Find In Page, 18 // In addition to WKWebView features, it allows Translate, Find In Page,
19 // Customizable Context Menus, and maybe more. 19 // Customizable Context Menus, and maybe more.
20 // 20 //
21 // Concrete instances can be created through CWV. 21 // Concrete instances can be created through CWV.
22 CWV_EXPORT 22 CWV_EXPORT
23 @interface CWVWebView : UIView 23 @interface CWVWebView : UIView
24 24
25 // The configuration of the web view. 25 // The configuration of the web view.
26 @property(nonatomic, readonly, copy) CWVWebViewConfiguration* configuration; 26 @property(nonatomic, readonly, copy) CWVWebViewConfiguration* configuration;
27 27
28 // This web view's navigation delegate. 28 // This web view's navigation delegate.
29 @property(nonatomic, weak) id<CWVNavigationDelegate> navigationDelegate; 29 @property(nonatomic, weak) id<CWVNavigationDelegate> navigationDelegate;
30 30
31 // This web view's translation controller.
32 @property(nonatomic, readonly) CWVTranslationController* translationController;
33
31 // This web view's UI delegate 34 // This web view's UI delegate
32 @property(nonatomic, weak) id<CWVUIDelegate> UIDelegate; 35 @property(nonatomic, weak) id<CWVUIDelegate> UIDelegate;
33 36
34 // A delegate for the translation feature.
35 @property(nonatomic, weak) id<CWVTranslateDelegate> translationDelegate;
36
37 // Whether or not this web view can go backwards or forwards. 37 // Whether or not this web view can go backwards or forwards.
38 @property(nonatomic, readonly) BOOL canGoBack; 38 @property(nonatomic, readonly) BOOL canGoBack;
39 @property(nonatomic, readonly) BOOL canGoForward; 39 @property(nonatomic, readonly) BOOL canGoForward;
40 40
41 // Whether or not this web view is loading a page. 41 // Whether or not this web view is loading a page.
42 @property(nonatomic, readonly) BOOL isLoading; 42 @property(nonatomic, readonly) BOOL isLoading;
43 43
44 // The URL displayed in the url bar. 44 // The URL displayed in the url bar.
45 @property(nonatomic, readonly) NSURL* visibleURL; 45 @property(nonatomic, readonly) NSURL* visibleURL;
46 46
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 - (void)loadRequest:(NSURLRequest*)request; 105 - (void)loadRequest:(NSURLRequest*)request;
106 106
107 // Evaluates a JavaScript string. 107 // Evaluates a JavaScript string.
108 // The completion handler is invoked when script evaluation completes. 108 // The completion handler is invoked when script evaluation completes.
109 - (void)evaluateJavaScript:(NSString*)javaScriptString 109 - (void)evaluateJavaScript:(NSString*)javaScriptString
110 completionHandler:(void (^)(id, NSError*))completionHandler; 110 completionHandler:(void (^)(id, NSError*))completionHandler;
111 111
112 @end 112 @end
113 113
114 #endif // IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_H_ 114 #endif // IOS_WEB_VIEW_PUBLIC_CWV_WEB_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698