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

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

Issue 2281803002: [ios] Removed deprecated JS execution API. (Closed)
Patch Set: Merged with master Created 4 years, 3 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
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller.mm ('k') | ios/web/web_state/ui/web_view_js_utils.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4
5 #ifndef IOS_WEB_WEB_STATE_UI_WEB_VIEW_JS_UTILS_H_ 5 #ifndef IOS_WEB_WEB_STATE_UI_WEB_VIEW_JS_UTILS_H_
6 #define IOS_WEB_WEB_STATE_UI_WEB_VIEW_JS_UTILS_H_ 6 #define IOS_WEB_WEB_STATE_UI_WEB_VIEW_JS_UTILS_H_
7 7
8 #import <Foundation/Foundation.h> 8 #import <Foundation/Foundation.h>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 12 matching lines...) Expand all
23 23
24 // The type of errors that can occur while evaluating JS. 24 // The type of errors that can occur while evaluating JS.
25 enum JSEvaluationErrorCode { 25 enum JSEvaluationErrorCode {
26 // No web view present to evaluate JS. 26 // No web view present to evaluate JS.
27 JS_EVALUATION_ERROR_CODE_NO_WEB_VIEW = 1, 27 JS_EVALUATION_ERROR_CODE_NO_WEB_VIEW = 1,
28 }; 28 };
29 29
30 // Converts result of WKWebView script evaluation to base::Value. 30 // Converts result of WKWebView script evaluation to base::Value.
31 std::unique_ptr<base::Value> ValueResultFromWKResult(id result); 31 std::unique_ptr<base::Value> ValueResultFromWKResult(id result);
32 32
33 // Evaluates JavaScript on WKWebView. Provides evaluation result as a string.
34 // If the web view cannot evaluate JS at the moment, |completion_handler| is
35 // called with an NSError.
36 void EvaluateJavaScript(WKWebView* web_view,
37 NSString* script,
38 JavaScriptCompletion completion_handler);
39
40 // Executes JavaScript on WKWebView. If the web view cannot execute JS at the 33 // Executes JavaScript on WKWebView. If the web view cannot execute JS at the
41 // moment, |completion_handler| is called with an NSError. 34 // moment, |completion_handler| is called with an NSError.
42 void ExecuteJavaScript(WKWebView* web_view, 35 void ExecuteJavaScript(WKWebView* web_view,
43 NSString* script, 36 NSString* script,
44 JavaScriptResultBlock completion_handler); 37 JavaScriptResultBlock completion_handler);
45 38
46 } // namespace web 39 } // namespace web
47 40
48 #endif // IOS_WEB_WEB_STATE_UI_WEB_VIEW_JS_UTILS_H_ 41 #endif // IOS_WEB_WEB_STATE_UI_WEB_VIEW_JS_UTILS_H_
OLDNEW
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller.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