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

Unified Diff: ios/web/public/web_state/js/crw_js_injection_receiver.h

Issue 790803002: Upstream JavaScript injection for iOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/public/web_state/js/crw_js_injection_receiver.h
diff --git a/ios/web/public/web_state/js/crw_js_injection_receiver.h b/ios/web/public/web_state/js/crw_js_injection_receiver.h
new file mode 100644
index 0000000000000000000000000000000000000000..e3ff0796e3f3c53620c6683c9d3efe5f1f7065af
--- /dev/null
+++ b/ios/web/public/web_state/js/crw_js_injection_receiver.h
@@ -0,0 +1,31 @@
+// Copyright 2012 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_PUBLIC_WEB_STATE_JS_CRW_JS_INJECTION_RECEIVER_H_
+#define IOS_WEB_PUBLIC_WEB_STATE_JS_CRW_JS_INJECTION_RECEIVER_H_
+
+#import <UIKit/UIKit.h>
+
+#include "ios/web/public/web_state/js/crw_js_injection_evaluator.h"
+
+@class CRWJSInjectionManager;
+
+// CRWJSInjectionReceiver injects JavaScript into a web view.
+@interface CRWJSInjectionReceiver : NSObject<CRWJSInjectionEvaluator>
+
+// Init with JavaScript evaluator.
+- (id)initWithEvaluator:(id<CRWJSInjectionEvaluator>)evaluator;
+
+// Returns an instance of |jsInjectionManagerClass|. Instances of the classes
+// it depends on are created if needed.
+- (CRWJSInjectionManager*)instanceOfClass:(Class)jsInjectionManagerClass;
+
+@end
+
+@interface CRWJSInjectionReceiver (Testing)
+// Returns a dictionary of instantiated managers keyed by class.
+- (NSDictionary*)managers;
+@end
+
+#endif // IOS_WEB_PUBLIC_WEB_STATE_JS_CRW_JS_INJECTION_RECEIVER_H_

Powered by Google App Engine
This is Rietveld 408576698