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

Unified Diff: ios/web_view/public/cwv_user_content_controller.h

Issue 2764773002: Add CWVUserContentController which enables injecting JavaScripts. (Closed)
Patch Set: Apply new comments. Created 3 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
Index: ios/web_view/public/cwv_user_content_controller.h
diff --git a/ios/web_view/public/cwv_user_content_controller.h b/ios/web_view/public/cwv_user_content_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..7a4b81378dcbc72a44696e8be42c05a361426134
--- /dev/null
+++ b/ios/web_view/public/cwv_user_content_controller.h
@@ -0,0 +1,30 @@
+// Copyright 2017 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_VIEW_PUBLIC_CWV_USER_CONTENT_CONTROLLER_H_
+#define IOS_WEB_VIEW_PUBLIC_CWV_USER_CONTENT_CONTROLLER_H_
+
+#import <Foundation/Foundation.h>
+
+@class CWVUserScript;
+
+// Allows injecting custom scripts into CWVWebView created with the
+// configuration.
+@interface CWVUserContentController : NSObject
+
+// The user scripts associated with the configuration.
+@property(nonatomic, copy, readonly, nonnull)
+ NSArray<CWVUserScript*>* userScripts;
+
+- (nullable instancetype)init NS_UNAVAILABLE;
+
+// Adds a user script.
+- (void)addUserScript:(nonnull CWVUserScript*)userScript;
+
+// Removes all associated user scripts.
+- (void)removeAllUserScripts;
+
+@end
+
+#endif // IOS_WEB_VIEW_PUBLIC_CWV_USER_CONTENT_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698