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

Unified Diff: ios/web_view/public/criwv_web_view.h

Issue 2643773005: Upstream ios/web_view source code. (Closed)
Patch Set: Remove request tracker and fix pointer to CRIWVWebMainParts. Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: ios/web_view/public/criwv_web_view.h
diff --git a/ios/web_view/public/criwv_web_view.h b/ios/web_view/public/criwv_web_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..0c3bc9d4918525279a823fd44c1f57e4c5b973f2
--- /dev/null
+++ b/ios/web_view/public/criwv_web_view.h
@@ -0,0 +1,59 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+#ifndef IOS_WEB_VIEW_PUBLIC_CRIWV_WEB_VIEW_H_
+#define IOS_WEB_VIEW_PUBLIC_CRIWV_WEB_VIEW_H_
+
+#import <UIKit/UIKit.h>
+
+@protocol CRIWVWebViewDelegate;
+
+// Primary objective-c interface for web/. Just like a UIWebView, but better.
+// Concrete instances can be created through CRIWV.
+@protocol CRIWVWebView<NSObject>
+
+// The view used to display web content.
+@property(nonatomic, readonly) UIView* view;
+
+// This web view's delegate.
+@property(nonatomic, readwrite, assign) id<CRIWVWebViewDelegate> delegate;
+
+// Whether or not this web view can go backwards or forwards.
+@property(nonatomic, readonly) BOOL canGoBack;
+@property(nonatomic, readonly) BOOL canGoForward;
+
+// Whether or not this web view is loading a page.
+@property(nonatomic, readonly) BOOL isLoading;
+
+// The current URL, for display to the user.
+@property(nonatomic, readonly) NSURL* visibleURL;
+
+// The current page title.
+@property(nonatomic, readonly) NSString* pageTitle;
+
+// The current load progress, as a fraction between 0 and 1. This value is
+// undefined if the web view is not currently loading.
+@property(nonatomic, readonly) CGFloat loadProgress;
+
+// Navigates backwards or forwards by one page. Does nothing if the
+// corresponding |canGoBack| or |canGoForward| method returns NO.
+- (void)goBack;
+- (void)goForward;
+
+// Reloads the current page.
+- (void)reload;
+
+// Stops loading the current page.
+- (void)stopLoading;
+
+// Loads the given |url| in this web view.
+- (void)loadURL:(NSURL*)url;
+
+// Evaluates a JavaScript string.
+// The completion handler is invoked when script evaluation completes.
+- (void)evaluateJavaScript:(NSString*)javaScriptString
+ completionHandler:(void (^)(id, NSError*))completionHandler;
+
+@end
+
+#endif // IOS_WEB_VIEW_PUBLIC_CRIWV_WEB_VIEW_H_

Powered by Google App Engine
This is Rietveld 408576698