OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/shared_memory.h" | 13 #include "base/shared_memory.h" |
14 #include "base/timer.h" | 14 #include "base/timer.h" |
15 #include "content/public/renderer/render_process_observer.h" | 15 #include "content/public/renderer/render_process_observer.h" |
16 #include "chrome/common/extensions/extension_set.h" | 16 #include "chrome/common/extensions/extension_set.h" |
17 #include "chrome/renderer/extensions/chrome_v8_context_set.h" | 17 #include "chrome/renderer/extensions/chrome_v8_context_set.h" |
18 #include "v8/include/v8.h" | 18 #include "v8/include/v8.h" |
19 | 19 |
| 20 class ModuleSystem; |
20 class GURL; | 21 class GURL; |
21 class URLPattern; | 22 class URLPattern; |
22 class UserScriptSlave; | 23 class UserScriptSlave; |
23 struct ExtensionMsg_Loaded_Params; | 24 struct ExtensionMsg_Loaded_Params; |
24 | 25 |
25 namespace WebKit { | 26 namespace WebKit { |
26 class WebFrame; | 27 class WebFrame; |
27 } | 28 } |
28 | 29 |
29 namespace base { | 30 namespace base { |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // Calls RenderThread's RegisterExtension and keeps tracks of which v8 | 131 // Calls RenderThread's RegisterExtension and keeps tracks of which v8 |
131 // extension is for Chrome Extensions only. | 132 // extension is for Chrome Extensions only. |
132 void RegisterExtension(v8::Extension* extension, bool restrict_to_extensions); | 133 void RegisterExtension(v8::Extension* extension, bool restrict_to_extensions); |
133 | 134 |
134 // Sets up the host permissions for |extension|. | 135 // Sets up the host permissions for |extension|. |
135 void InitOriginPermissions(const Extension* extension); | 136 void InitOriginPermissions(const Extension* extension); |
136 void UpdateOriginPermissions(UpdatedExtensionPermissionsInfo::Reason reason, | 137 void UpdateOriginPermissions(UpdatedExtensionPermissionsInfo::Reason reason, |
137 const Extension* extension, | 138 const Extension* extension, |
138 const URLPatternSet& origins); | 139 const URLPatternSet& origins); |
139 | 140 |
| 141 void RegisterNativeHandlers(ModuleSystem* module_system, |
| 142 ChromeV8Context* context, |
| 143 bool is_bindings_allowed); |
| 144 |
140 // Finds the extension ID for the current context. This is determined from | 145 // Finds the extension ID for the current context. This is determined from |
141 // |world_id| if it's non-zero, or the URL in |frame| if it is. | 146 // |world_id| if it's non-zero, or the URL in |frame| if it is. |
142 std::string GetExtensionID(WebKit::WebFrame* frame, int world_id); | 147 std::string GetExtensionID(WebKit::WebFrame* frame, int world_id); |
143 | 148 |
144 // True if this renderer is running extensions. | 149 // True if this renderer is running extensions. |
145 bool is_extension_process_; | 150 bool is_extension_process_; |
146 | 151 |
147 // Contains all loaded extensions. This is essentially the renderer | 152 // Contains all loaded extensions. This is essentially the renderer |
148 // counterpart to ExtensionService in the browser. It contains information | 153 // counterpart to ExtensionService in the browser. It contains information |
149 // about all extensions currently loaded by the browser. | 154 // about all extensions currently loaded by the browser. |
(...skipping 29 matching lines...) Expand all Loading... |
179 // Status of webrequest usage for known extensions. | 184 // Status of webrequest usage for known extensions. |
180 // TODO(mpcomplete): remove. http://crbug.com/100411 | 185 // TODO(mpcomplete): remove. http://crbug.com/100411 |
181 bool webrequest_adblock_; | 186 bool webrequest_adblock_; |
182 bool webrequest_adblock_plus_; | 187 bool webrequest_adblock_plus_; |
183 bool webrequest_other_; | 188 bool webrequest_other_; |
184 | 189 |
185 DISALLOW_COPY_AND_ASSIGN(ExtensionDispatcher); | 190 DISALLOW_COPY_AND_ASSIGN(ExtensionDispatcher); |
186 }; | 191 }; |
187 | 192 |
188 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ | 193 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ |
OLD | NEW |