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

Side by Side Diff: ios/web/web_state/ui/web_view_js_utils.h

Issue 914993006: Upstream web_controller_provider and dependencies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@libusb
Patch Set: git cl upload --no-find-copies Created 5 years, 10 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
(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
5 #ifndef IOS_WEB_WEB_STATE_UI_WEB_VIEW_JS_UTILS_H_
6 #define IOS_WEB_WEB_STATE_UI_WEB_VIEW_JS_UTILS_H_
7
8 #import <Foundation/Foundation.h>
9
10 @class UIWebView;
11 @class WKWebView;
12
13 // This file contains functions that asynchronously evaluate JavaScript on
14 // WKWebView/UIWebView and provide result in the same format. Call
15 // |completion_handler| with results of the evaluation or an NSError if there is
16 // an error. The |completion_handler| can be nil.
17 namespace web {
18
19 // The type of the completion handler block that is called to inform about
20 // JavaScript evaluation completion.
21 typedef void (^JavaScriptCompletion)(NSString*, NSError*);
22
23 // Asynchronous adaptor to evaluate JavaScript on UIWebView. Provides evaluation
24 // result as it is, without modifications.
25 void EvaluateJavaScript(UIWebView* web_view,
26 NSString* script,
27 JavaScriptCompletion completion_handler);
28
29 // Evaluates JavaScript on WKWebView. Provides evaluation result is the same
30 // format as UIWebView.
31 void EvaluateJavaScript(WKWebView* web_view,
32 NSString* script,
33 JavaScriptCompletion completion_handler);
34
35 } // namespace web
36
37 #endif // IOS_WEB_WEB_STATE_UI_WEB_VIEW_JS_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698