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

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: Make the sync_IPC handled in IO thread. 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 uint32 remove_mask_; 424 uint32 remove_mask_;
392 // Tracks any data related or parse errors. 425 // Tracks any data related or parse errors.
393 bool bad_message_; 426 bool bad_message_;
394 427
395 DISALLOW_COPY_AND_ASSIGN(WebViewInternalClearDataFunction); 428 DISALLOW_COPY_AND_ASSIGN(WebViewInternalClearDataFunction);
396 }; 429 };
397 430
398 } // namespace extensions 431 } // namespace extensions
399 432
400 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_VIEW_WEB_VIEW_INTERNAL_API_H_ 433 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_VIEW_WEB_VIEW_INTERNAL_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698