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

Unified Diff: ios/web/web_state/ui/web_view_js_utils.h

Issue 1048613002: Upstream ios/web/web_state/ui support classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clang format Created 5 years, 9 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
« no previous file with comments | « ios/web/web_state/ui/crw_wk_web_view_crash_detector.mm ('k') | ios/web/web_state/ui/web_view_js_utils.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/web_view_js_utils.h
diff --git a/ios/web/web_state/ui/web_view_js_utils.h b/ios/web/web_state/ui/web_view_js_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..a51dd55c7f2ae2abfca475f397b7dd9bd0f3b8a9
--- /dev/null
+++ b/ios/web/web_state/ui/web_view_js_utils.h
@@ -0,0 +1,35 @@
+// 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_WEB_STATE_UI_WEB_VIEW_JS_UTILS_H_
+#define IOS_WEB_WEB_STATE_UI_WEB_VIEW_JS_UTILS_H_
+
+#import <Foundation/Foundation.h>
+
+#include "ios/web/public/block_types.h"
+
+@class UIWebView;
+@class WKWebView;
+
+// This file contains functions that asynchronously evaluate JavaScript on
+// WKWebView/UIWebView and provide result in the same format. Call
+// |completion_handler| with results of the evaluation or an NSError if there is
+// an error. The |completion_handler| can be nil.
+namespace web {
+
+// Asynchronous adaptor to evaluate JavaScript on UIWebView. Provides evaluation
+// result as it is, without modifications.
+void EvaluateJavaScript(UIWebView* web_view,
+ NSString* script,
+ JavaScriptCompletion completion_handler);
+
+// Evaluates JavaScript on WKWebView. Provides evaluation result is the same
+// format as UIWebView.
+void EvaluateJavaScript(WKWebView* web_view,
+ NSString* script,
+ JavaScriptCompletion completion_handler);
+
+} // namespace web
+
+#endif // IOS_WEB_WEB_STATE_UI_WEB_VIEW_JS_UTILS_H_
« no previous file with comments | « ios/web/web_state/ui/crw_wk_web_view_crash_detector.mm ('k') | ios/web/web_state/ui/web_view_js_utils.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698