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

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: Add 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 : public AsyncExtensionFunction {
133 public:
134 DECLARE_EXTENSION_FUNCTION("webViewInternal.addContentScripts",
135 WEBVIEWINTERNAL_ADDCONTENTSCRIPTS);
136
137 WebViewInternalAddContentScriptsFunction();
138
139 protected:
140 ~WebViewInternalAddContentScriptsFunction() override;
141
142 private:
143 bool RunAsync() override;
144
145 DISALLOW_COPY_AND_ASSIGN(WebViewInternalAddContentScriptsFunction);
146 };
147
148 class WebViewInternalRemoveContentScriptsFunction
149 : public AsyncExtensionFunction {
150 public:
151 DECLARE_EXTENSION_FUNCTION("webViewInternal.removeContentScripts",
152 WEBVIEWINTERNAL_REMOVECONTENTSCRIPTS);
153
154 WebViewInternalRemoveContentScriptsFunction();
155
156 protected:
157 ~WebViewInternalRemoveContentScriptsFunction() override;
158
159 private:
160 bool RunAsync() override;
161
162 DISALLOW_COPY_AND_ASSIGN(WebViewInternalRemoveContentScriptsFunction);
163 };
164
132 class WebViewInternalSetNameFunction : public WebViewInternalExtensionFunction { 165 class WebViewInternalSetNameFunction : public WebViewInternalExtensionFunction {
133 public: 166 public:
134 DECLARE_EXTENSION_FUNCTION("webViewInternal.setName", 167 DECLARE_EXTENSION_FUNCTION("webViewInternal.setName",
135 WEBVIEWINTERNAL_SETNAME); 168 WEBVIEWINTERNAL_SETNAME);
136 169
137 WebViewInternalSetNameFunction(); 170 WebViewInternalSetNameFunction();
138 171
139 protected: 172 protected:
140 ~WebViewInternalSetNameFunction() override; 173 ~WebViewInternalSetNameFunction() override;
141 174
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 uint32 remove_mask_; 458 uint32 remove_mask_;
426 // Tracks any data related or parse errors. 459 // Tracks any data related or parse errors.
427 bool bad_message_; 460 bool bad_message_;
428 461
429 DISALLOW_COPY_AND_ASSIGN(WebViewInternalClearDataFunction); 462 DISALLOW_COPY_AND_ASSIGN(WebViewInternalClearDataFunction);
430 }; 463 };
431 464
432 } // namespace extensions 465 } // namespace extensions
433 466
434 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_VIEW_WEB_VIEW_INTERNAL_API_H_ 467 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_VIEW_WEB_VIEW_INTERNAL_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698