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

Side by Side Diff: extensions/browser/api/guest_view/web_view/web_view_internal_api.h

Issue 959413003: Implement <webview>.addContentScript/removeContentScript API [1] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Delvin's comments. Created 5 years, 8 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
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 EXTENSIONS_BROWSER_API_WEB_VIEW_WEB_VIEW_INTERNAL_API_H_ 5 #ifndef EXTENSIONS_BROWSER_API_WEB_VIEW_WEB_VIEW_INTERNAL_API_H_
6 #define EXTENSIONS_BROWSER_API_WEB_VIEW_WEB_VIEW_INTERNAL_API_H_ 6 #define EXTENSIONS_BROWSER_API_WEB_VIEW_WEB_VIEW_INTERNAL_API_H_
7 7
8 #include "extensions/browser/api/capture_web_contents_function.h" 8 #include "extensions/browser/api/capture_web_contents_function.h"
9 #include "extensions/browser/api/execute_code_function.h" 9 #include "extensions/browser/api/execute_code_function.h"
10 #include "extensions/browser/extension_function.h" 10 #include "extensions/browser/extension_function.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 bool ShouldInsertCSS() const override; 123 bool ShouldInsertCSS() const override;
124 124
125 DECLARE_EXTENSION_FUNCTION("webViewInternal.insertCSS", 125 DECLARE_EXTENSION_FUNCTION("webViewInternal.insertCSS",
126 WEBVIEWINTERNAL_INSERTCSS) 126 WEBVIEWINTERNAL_INSERTCSS)
127 127
128 private: 128 private:
129 DISALLOW_COPY_AND_ASSIGN(WebViewInternalInsertCSSFunction); 129 DISALLOW_COPY_AND_ASSIGN(WebViewInternalInsertCSSFunction);
130 }; 130 };
131 131
132 class WebViewInternalAddContentScriptsFunction
133 : public UIThreadExtensionFunction {
134 public:
135 DECLARE_EXTENSION_FUNCTION("webViewInternal.addContentScripts",
136 WEBVIEWINTERNAL_ADDCONTENTSCRIPTS);
137
138 WebViewInternalAddContentScriptsFunction();
139
140 protected:
141 ~WebViewInternalAddContentScriptsFunction() override;
142
143 private:
144 ExecuteCodeFunction::ResponseAction Run() final;
Devlin 2015/04/14 23:04:57 While the "final" here is probably true, we usuall
Xi Han 2015/04/15 19:43:55 I think I got compiling errors when I first used o
145
146 DISALLOW_COPY_AND_ASSIGN(WebViewInternalAddContentScriptsFunction);
147 };
148
149 class WebViewInternalRemoveContentScriptsFunction
150 : public UIThreadExtensionFunction {
151 public:
152 DECLARE_EXTENSION_FUNCTION("webViewInternal.removeContentScripts",
153 WEBVIEWINTERNAL_REMOVECONTENTSCRIPTS);
154
155 WebViewInternalRemoveContentScriptsFunction();
156
157 protected:
158 ~WebViewInternalRemoveContentScriptsFunction() override;
159
160 private:
161 ExecuteCodeFunction::ResponseAction Run() final;
162
163 DISALLOW_COPY_AND_ASSIGN(WebViewInternalRemoveContentScriptsFunction);
164 };
165
132 class WebViewInternalSetNameFunction : public WebViewInternalExtensionFunction { 166 class WebViewInternalSetNameFunction : public WebViewInternalExtensionFunction {
133 public: 167 public:
134 DECLARE_EXTENSION_FUNCTION("webViewInternal.setName", 168 DECLARE_EXTENSION_FUNCTION("webViewInternal.setName",
135 WEBVIEWINTERNAL_SETNAME); 169 WEBVIEWINTERNAL_SETNAME);
136 170
137 WebViewInternalSetNameFunction(); 171 WebViewInternalSetNameFunction();
138 172
139 protected: 173 protected:
140 ~WebViewInternalSetNameFunction() override; 174 ~WebViewInternalSetNameFunction() override;
141 175
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 uint32 remove_mask_; 459 uint32 remove_mask_;
426 // Tracks any data related or parse errors. 460 // Tracks any data related or parse errors.
427 bool bad_message_; 461 bool bad_message_;
428 462
429 DISALLOW_COPY_AND_ASSIGN(WebViewInternalClearDataFunction); 463 DISALLOW_COPY_AND_ASSIGN(WebViewInternalClearDataFunction);
430 }; 464 };
431 465
432 } // namespace extensions 466 } // namespace extensions
433 467
434 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_VIEW_WEB_VIEW_INTERNAL_API_H_ 468 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_VIEW_WEB_VIEW_INTERNAL_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698