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

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

Issue 2764773002: Add CWVUserContentController which enables injecting JavaScripts. (Closed)
Patch Set: Add license. 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_script.h
diff --git a/ios/web_view/public/cwv_user_script.h b/ios/web_view/public/cwv_user_script.h
new file mode 100644
index 0000000000000000000000000000000000000000..e7bb81dfd1dfb4004536e1688ab09bf4e3c8ca4e
--- /dev/null
+++ b/ios/web_view/public/cwv_user_script.h
@@ -0,0 +1,25 @@
+// 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_SCRIPT_H_
+#define IOS_WEB_VIEW_PUBLIC_CWV_USER_SCRIPT_H_
+
+#import <Foundation/Foundation.h>
+
+// User Script to be injected into main frame of CWVWebView after
+// window.document is created, but before other content is
+// loaded (i.e., at the same timing as
michaeldo 2017/03/21 16:12:35 please re-wrap this comment
Hiroshi Ichikawa 2017/03/22 04:52:53 Done.
+// WKUserScriptInjectionTimeAtDocumentStart).
+__attribute__((visibility("default")))
michaeldo 2017/03/21 16:12:35 I think we shuold remove the visibility attribute
Hiroshi Ichikawa 2017/03/22 04:52:53 Sure. Reverted. I added this here because my test
michaeldo 2017/03/22 23:03:33 Understandable, thank you for creating the separat
+@interface CWVUserScript : NSObject
+
+// JavaScript source code.
+@property(copy, readonly) NSString* source;
michaeldo 2017/03/21 16:12:35 Please add nullability annotations to this newly c
Eugene But (OOO till 7-30) 2017/03/21 16:47:55 nonatomic?
Hiroshi Ichikawa 2017/03/22 04:52:53 Done.
Hiroshi Ichikawa 2017/03/22 04:52:53 Done.
+
+- (instancetype)init NS_UNAVAILABLE;
+
+- (instancetype)initWithSource:(NSString*)source;
Eugene But (OOO till 7-30) 2017/03/21 16:47:55 Do you want to add nonnull to |source|?
Hiroshi Ichikawa 2017/03/22 04:52:53 Done.
+
+@end
+
+#endif // IOS_WEB_VIEW_PUBLIC_CWV_USER_SCRIPT_H_

Powered by Google App Engine
This is Rietveld 408576698