| 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.h" |
| 17 #include "chrome/renderer/extensions/chrome_v8_context_set.h" | 18 #include "chrome/renderer/extensions/chrome_v8_context_set.h" |
| 18 #include "v8/include/v8.h" | 19 #include "v8/include/v8.h" |
| 19 | 20 |
| 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; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 // Sets up the host permissions for |extension|. | 136 // Sets up the host permissions for |extension|. |
| 136 void InitOriginPermissions(const Extension* extension); | 137 void InitOriginPermissions(const Extension* extension); |
| 137 void UpdateOriginPermissions(UpdatedExtensionPermissionsInfo::Reason reason, | 138 void UpdateOriginPermissions(UpdatedExtensionPermissionsInfo::Reason reason, |
| 138 const Extension* extension, | 139 const Extension* extension, |
| 139 const URLPatternSet& origins); | 140 const URLPatternSet& origins); |
| 140 | 141 |
| 141 // Finds the extension ID for the current context. This is determined from | 142 // Finds the extension ID for the current context. This is determined from |
| 142 // |world_id| if it's non-zero, or the URL in |frame| if it is. | 143 // |world_id| if it's non-zero, or the URL in |frame| if it is. |
| 143 std::string GetExtensionID(WebKit::WebFrame* frame, int world_id); | 144 std::string GetExtensionID(WebKit::WebFrame* frame, int world_id); |
| 144 | 145 |
| 146 // Gets the type of context that would be created for a v8 extension group |
| 147 // on a frame. |
| 148 ChromeV8Context::ContextType GetContextType(int extension_group, |
| 149 WebKit::WebFrame* frame); |
| 150 |
| 145 // True if this renderer is running extensions. | 151 // True if this renderer is running extensions. |
| 146 bool is_extension_process_; | 152 bool is_extension_process_; |
| 147 | 153 |
| 148 // Contains all loaded extensions. This is essentially the renderer | 154 // Contains all loaded extensions. This is essentially the renderer |
| 149 // counterpart to ExtensionService in the browser. It contains information | 155 // counterpart to ExtensionService in the browser. It contains information |
| 150 // about all extensions currently loaded by the browser. | 156 // about all extensions currently loaded by the browser. |
| 151 ExtensionSet extensions_; | 157 ExtensionSet extensions_; |
| 152 | 158 |
| 153 // All the bindings contexts that are currently loaded for this renderer. | 159 // All the bindings contexts that are currently loaded for this renderer. |
| 154 // There is zero or one for each v8 context. | 160 // There is zero or one for each v8 context. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 180 // Status of webrequest usage for known extensions. | 186 // Status of webrequest usage for known extensions. |
| 181 // TODO(mpcomplete): remove. http://crbug.com/100411 | 187 // TODO(mpcomplete): remove. http://crbug.com/100411 |
| 182 bool webrequest_adblock_; | 188 bool webrequest_adblock_; |
| 183 bool webrequest_adblock_plus_; | 189 bool webrequest_adblock_plus_; |
| 184 bool webrequest_other_; | 190 bool webrequest_other_; |
| 185 | 191 |
| 186 DISALLOW_COPY_AND_ASSIGN(ExtensionDispatcher); | 192 DISALLOW_COPY_AND_ASSIGN(ExtensionDispatcher); |
| 187 }; | 193 }; |
| 188 | 194 |
| 189 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ | 195 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ |
| OLD | NEW |