Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 #ifndef IOS_WEB_VIEW_PUBLIC_CRIWV_WEB_VIEW_H_ | |
| 5 #define IOS_WEB_VIEW_PUBLIC_CRIWV_WEB_VIEW_H_ | |
| 6 | |
| 7 #import <UIKit/UIKit.h> | |
| 8 | |
| 9 @protocol CRIWVWebViewDelegate; | |
| 10 | |
| 11 // Primary objective-c interface for web/. Just like a UIWebView, but better. | |
|
sdefresne
2017/01/20 10:28:13
UIWebView -> WKWebView?
michaeldo
2017/01/24 22:35:26
Done in dep CL.
| |
| 12 // Concrete instances can be created through CRIWV. | |
| 13 @protocol CRIWVWebView<NSObject> | |
| 14 | |
| 15 // The view used to display web content. | |
| 16 @property(nonatomic, readonly) UIView* view; | |
| 17 | |
| 18 // This web view's delegate. | |
| 19 @property(nonatomic, readwrite, assign) id<CRIWVWebViewDelegate> delegate; | |
| 20 | |
| 21 // Whether or not this web view can go backwards or forwards. | |
| 22 @property(nonatomic, readonly) BOOL canGoBack; | |
| 23 @property(nonatomic, readonly) BOOL canGoForward; | |
| 24 | |
| 25 // Whether or not this web view is loading a page. | |
| 26 @property(nonatomic, readonly) BOOL isLoading; | |
| 27 | |
| 28 // The current URL, for display to the user. | |
| 29 @property(nonatomic, readonly) NSURL* visibleURL; | |
| 30 | |
| 31 // The current page title. | |
| 32 @property(nonatomic, readonly) NSString* pageTitle; | |
| 33 | |
| 34 // The current load progress, as a fraction between 0 and 1. This value is | |
| 35 // undefined if the web view is not currently loading. | |
| 36 @property(nonatomic, readonly) CGFloat loadProgress; | |
| 37 | |
| 38 // Navigates backwards or forwards by one page. Does nothing if the | |
| 39 // corresponding |canGoBack| or |canGoForward| method returns NO. | |
| 40 - (void)goBack; | |
| 41 - (void)goForward; | |
| 42 | |
| 43 // Reloads the current page. | |
| 44 - (void)reload; | |
| 45 | |
| 46 // Stops loading the current page. | |
| 47 - (void)stopLoading; | |
| 48 | |
| 49 // Loads the given |url| in this web view. | |
| 50 - (void)loadURL:(NSURL*)url; | |
| 51 | |
| 52 // Evaluates a JavaScript string. | |
| 53 // The completion handler is invoked when script evaluation completes. | |
| 54 - (void)evaluateJavaScript:(NSString*)javaScriptString | |
| 55 completionHandler:(void (^)(id, NSError*))completionHandler; | |
| 56 | |
| 57 @end | |
| 58 | |
| 59 #endif // IOS_WEB_VIEW_PUBLIC_CRIWV_WEB_VIEW_H_ | |
| OLD | NEW |