| 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> |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 void OnSetScriptingWhitelist( | 146 void OnSetScriptingWhitelist( |
| 147 const extensions::Extension::ScriptingWhitelist& extension_ids); | 147 const extensions::Extension::ScriptingWhitelist& extension_ids); |
| 148 void OnPageActionsUpdated(const std::string& extension_id, | 148 void OnPageActionsUpdated(const std::string& extension_id, |
| 149 const std::vector<std::string>& page_actions); | 149 const std::vector<std::string>& page_actions); |
| 150 void OnActivateExtension(const std::string& extension_id); | 150 void OnActivateExtension(const std::string& extension_id); |
| 151 void OnUpdatePermissions(int reason_id, | 151 void OnUpdatePermissions(int reason_id, |
| 152 const std::string& extension_id, | 152 const std::string& extension_id, |
| 153 const ExtensionAPIPermissionSet& apis, | 153 const ExtensionAPIPermissionSet& apis, |
| 154 const URLPatternSet& explicit_hosts, | 154 const URLPatternSet& explicit_hosts, |
| 155 const URLPatternSet& scriptable_hosts); | 155 const URLPatternSet& scriptable_hosts); |
| 156 void OnUpdateTabSpecificPermissions(int page_id, |
| 157 int tab_id, |
| 158 const std::string& extension_id, |
| 159 const URLPatternSet& origin_set); |
| 160 void OnClearTabSpecificPermissions( |
| 161 int tab_id, |
| 162 const std::vector<std::string>& extension_ids); |
| 156 void OnUpdateUserScripts(base::SharedMemoryHandle table); | 163 void OnUpdateUserScripts(base::SharedMemoryHandle table); |
| 157 void OnUsingWebRequestAPI( | 164 void OnUsingWebRequestAPI( |
| 158 bool adblock, | 165 bool adblock, |
| 159 bool adblock_plus, | 166 bool adblock_plus, |
| 160 bool other_webrequest); | 167 bool other_webrequest); |
| 161 void OnShouldUnload(const std::string& extension_id, int sequence_id); | 168 void OnShouldUnload(const std::string& extension_id, int sequence_id); |
| 162 void OnUnload(const std::string& extension_id); | 169 void OnUnload(const std::string& extension_id); |
| 163 | 170 |
| 164 // Update the list of active extensions that will be reported when we crash. | 171 // Update the list of active extensions that will be reported when we crash. |
| 165 void UpdateActiveExtensions(); | 172 void UpdateActiveExtensions(); |
| 166 | 173 |
| 167 // Calls RenderThread's RegisterExtension and keeps tracks of which v8 | 174 // Calls RenderThread's RegisterExtension and keeps tracks of which v8 |
| 168 // extension is for Chrome Extensions only. | 175 // extension is for Chrome Extensions only. |
| 169 void RegisterExtension(v8::Extension* extension, bool restrict_to_extensions); | 176 void RegisterExtension(v8::Extension* extension, bool restrict_to_extensions); |
| 170 | 177 |
| 171 // Sets up the host permissions for |extension|. | 178 // Sets up the host permissions for |extension|. |
| 172 void InitOriginPermissions(const extensions::Extension* extension); | 179 void InitOriginPermissions(const extensions::Extension* extension); |
| 173 void UpdateOriginPermissions( | 180 void AddOrRemoveOriginPermissions( |
| 174 extensions::UpdatedExtensionPermissionsInfo::Reason reason, | 181 extensions::UpdatedExtensionPermissionsInfo::Reason reason, |
| 175 const extensions::Extension* extension, | 182 const extensions::Extension* extension, |
| 176 const URLPatternSet& origins); | 183 const URLPatternSet& origins); |
| 177 | 184 |
| 178 void RegisterNativeHandlers(ModuleSystem* module_system, | 185 void RegisterNativeHandlers(ModuleSystem* module_system, |
| 179 ChromeV8Context* context); | 186 ChromeV8Context* context); |
| 180 | 187 |
| 181 // Inserts static source code into |source_map_|. | 188 // Inserts static source code into |source_map_|. |
| 182 void PopulateSourceMap(); | 189 void PopulateSourceMap(); |
| 183 | 190 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 scoped_ptr<ExtensionRequestSender> request_sender_; | 251 scoped_ptr<ExtensionRequestSender> request_sender_; |
| 245 | 252 |
| 246 // The current channel. From VersionInfo::GetChannel(). | 253 // The current channel. From VersionInfo::GetChannel(). |
| 247 // TODO(aa): Remove when we can restrict non-permission APIs to dev-only. | 254 // TODO(aa): Remove when we can restrict non-permission APIs to dev-only. |
| 248 int chrome_channel_; | 255 int chrome_channel_; |
| 249 | 256 |
| 250 DISALLOW_COPY_AND_ASSIGN(ExtensionDispatcher); | 257 DISALLOW_COPY_AND_ASSIGN(ExtensionDispatcher); |
| 251 }; | 258 }; |
| 252 | 259 |
| 253 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ | 260 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ |
| OLD | NEW |