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

Side by Side Diff: ios/web/public/web_state/js/crw_js_injection_evaluator.h

Issue 1808993002: [ios] Removed UIWebView JS evaluation code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added TODO Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | ios/web/web_state/ui/web_view_js_utils.h » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_PUBLIC_WEB_STATE_JS_CRW_JS_INJECTION_EVALUATOR_H_ 5 #ifndef IOS_WEB_PUBLIC_WEB_STATE_JS_CRW_JS_INJECTION_EVALUATOR_H_
6 #define IOS_WEB_PUBLIC_WEB_STATE_JS_CRW_JS_INJECTION_EVALUATOR_H_ 6 #define IOS_WEB_PUBLIC_WEB_STATE_JS_CRW_JS_INJECTION_EVALUATOR_H_
7 7
8 #import <Foundation/Foundation.h> 8 #import <Foundation/Foundation.h>
9 9
10 #include "ios/web/public/web_view_type.h" 10 #include "ios/web/public/web_view_type.h"
11 11
12 // The type of the completion handler block that is called from 12 // The type of the completion handler block that is called from
13 // |evaluateJavaScript:completionHandler| 13 // |evaluateJavaScript:completionHandler|
14 namespace web { 14 namespace web {
15 typedef void (^JavaScriptCompletion)(NSString*, NSError*); 15 typedef void (^JavaScriptCompletion)(NSString*, NSError*);
16 } 16 }
17 17
18 @protocol CRWJSInjectionEvaluator 18 @protocol CRWJSInjectionEvaluator
19 19
20 // Evaluates the supplied JavaScript in the WebView. Calls |completionHandler| 20 // Evaluates the supplied JavaScript in the WebView. Calls |completionHandler|
21 // with results of the evaluation (which may be nil if the implementing object 21 // with results of the evaluation (which may be nil if the implementing object
22 // has no way to run the evaluation or the evaluation returns a nil value) 22 // has no way to run the evaluation or the evaluation returns a nil value)
23 // or an NSError if there is an error. The |completionHandler| can be nil. 23 // or an NSError if there is an error. The |completionHandler| can be nil.
24 // TODO(crbug.com/595761): Change this API to return |id| instead of string.
24 - (void)evaluateJavaScript:(NSString*)script 25 - (void)evaluateJavaScript:(NSString*)script
25 stringResultHandler:(web::JavaScriptCompletion)handler; 26 stringResultHandler:(web::JavaScriptCompletion)handler;
26 27
27 // Checks to see if the script for a class has been injected into the 28 // Checks to see if the script for a class has been injected into the
28 // current page already, given the class and the script's presence 29 // current page already, given the class and the script's presence
29 // beacon (a JS object that should exist iff the script has been injected). 30 // beacon (a JS object that should exist iff the script has been injected).
30 - (BOOL)scriptHasBeenInjectedForClass:(Class)jsInjectionManagerClass 31 - (BOOL)scriptHasBeenInjectedForClass:(Class)jsInjectionManagerClass
31 presenceBeacon:(NSString*)beacon; 32 presenceBeacon:(NSString*)beacon;
32 33
33 // Injects the given script into the current page on behalf of 34 // Injects the given script into the current page on behalf of
34 // |jsInjectionManagerClass|. This should only be used for injecting 35 // |jsInjectionManagerClass|. This should only be used for injecting
35 // the manager's script, and not for evaluating arbitrary JavaScript. 36 // the manager's script, and not for evaluating arbitrary JavaScript.
36 - (void)injectScript:(NSString*)script forClass:(Class)jsInjectionManagerClass; 37 - (void)injectScript:(NSString*)script forClass:(Class)jsInjectionManagerClass;
37 38
38 // Returns type of web view used for evaluation. Must not change for the 39 // Returns type of web view used for evaluation. Must not change for the
39 // lifetime of the object. 40 // lifetime of the object.
40 - (web::WebViewType)webViewType; 41 - (web::WebViewType)webViewType;
41 42
42 @end 43 @end
43 44
44 #endif // IOS_WEB_PUBLIC_WEB_STATE_JS_CRW_JS_INJECTION_EVALUATOR_H_ 45 #endif // IOS_WEB_PUBLIC_WEB_STATE_JS_CRW_JS_INJECTION_EVALUATOR_H_
OLDNEW
« no previous file with comments | « no previous file | ios/web/web_state/ui/web_view_js_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698