| OLD | NEW |
| 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_RENDERER_DISPATCHER_H_ | 5 #ifndef EXTENSIONS_RENDERER_DISPATCHER_H_ |
| 6 #define EXTENSIONS_RENDERER_DISPATCHER_H_ | 6 #define EXTENSIONS_RENDERER_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 // Returns a list of (module name, resource id) pairs for the JS modules to | 143 // Returns a list of (module name, resource id) pairs for the JS modules to |
| 144 // add to the source map. | 144 // add to the source map. |
| 145 static std::vector<std::pair<std::string, int> > GetJsResources(); | 145 static std::vector<std::pair<std::string, int> > GetJsResources(); |
| 146 static void RegisterNativeHandlers(ModuleSystem* module_system, | 146 static void RegisterNativeHandlers(ModuleSystem* module_system, |
| 147 ScriptContext* context, | 147 ScriptContext* context, |
| 148 Dispatcher* dispatcher, | 148 Dispatcher* dispatcher, |
| 149 RequestSender* request_sender, | 149 RequestSender* request_sender, |
| 150 V8SchemaRegistry* v8_schema_registry); | 150 V8SchemaRegistry* v8_schema_registry); |
| 151 | 151 |
| 152 bool WasWebRequestUsedBySomeExtensions() const { return webrequest_used_; } | |
| 153 | |
| 154 private: | 152 private: |
| 155 // The RendererPermissionsPolicyDelegateTest.CannotScriptWebstore test needs | 153 // The RendererPermissionsPolicyDelegateTest.CannotScriptWebstore test needs |
| 156 // to call the OnActivateExtension IPCs. | 154 // to call the OnActivateExtension IPCs. |
| 157 friend class ::ChromeRenderViewTest; | 155 friend class ::ChromeRenderViewTest; |
| 158 FRIEND_TEST_ALL_PREFIXES(RendererPermissionsPolicyDelegateTest, | 156 FRIEND_TEST_ALL_PREFIXES(RendererPermissionsPolicyDelegateTest, |
| 159 CannotScriptWebstore); | 157 CannotScriptWebstore); |
| 160 | 158 |
| 161 // RenderThreadObserver implementation: | 159 // RenderThreadObserver implementation: |
| 162 bool OnControlMessageReceived(const IPC::Message& message) override; | 160 bool OnControlMessageReceived(const IPC::Message& message) override; |
| 163 void IdleNotification() override; | 161 void IdleNotification() override; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 void OnUpdatePermissions(const ExtensionMsg_UpdatePermissions_Params& params); | 193 void OnUpdatePermissions(const ExtensionMsg_UpdatePermissions_Params& params); |
| 196 void OnUpdateTabSpecificPermissions(const GURL& visible_url, | 194 void OnUpdateTabSpecificPermissions(const GURL& visible_url, |
| 197 const std::string& extension_id, | 195 const std::string& extension_id, |
| 198 const URLPatternSet& new_hosts, | 196 const URLPatternSet& new_hosts, |
| 199 bool update_origin_whitelist, | 197 bool update_origin_whitelist, |
| 200 int tab_id); | 198 int tab_id); |
| 201 void OnClearTabSpecificPermissions( | 199 void OnClearTabSpecificPermissions( |
| 202 const std::vector<std::string>& extension_ids, | 200 const std::vector<std::string>& extension_ids, |
| 203 bool update_origin_whitelist, | 201 bool update_origin_whitelist, |
| 204 int tab_id); | 202 int tab_id); |
| 205 void OnUsingWebRequestAPI(bool webrequest_used); | 203 |
| 206 void OnSetActivityLoggingEnabled(bool enabled); | 204 void OnSetActivityLoggingEnabled(bool enabled); |
| 207 | 205 |
| 208 // UserScriptSetManager::Observer implementation. | 206 // UserScriptSetManager::Observer implementation. |
| 209 void OnUserScriptsUpdated(const std::set<HostID>& changed_hosts) override; | 207 void OnUserScriptsUpdated(const std::set<HostID>& changed_hosts) override; |
| 210 | 208 |
| 211 void UpdateActiveExtensions(); | 209 void UpdateActiveExtensions(); |
| 212 | 210 |
| 213 // Sets up the host permissions for |extension|. | 211 // Sets up the host permissions for |extension|. |
| 214 void InitOriginPermissions(const Extension* extension); | 212 void InitOriginPermissions(const Extension* extension); |
| 215 | 213 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 | 301 |
| 304 // The platforms system font family and size; | 302 // The platforms system font family and size; |
| 305 std::string system_font_family_; | 303 std::string system_font_family_; |
| 306 std::string system_font_size_; | 304 std::string system_font_size_; |
| 307 | 305 |
| 308 // It is important for this to come after the ScriptInjectionManager, so that | 306 // It is important for this to come after the ScriptInjectionManager, so that |
| 309 // the observer is destroyed before the UserScriptSet. | 307 // the observer is destroyed before the UserScriptSet. |
| 310 ScopedObserver<UserScriptSetManager, UserScriptSetManager::Observer> | 308 ScopedObserver<UserScriptSetManager, UserScriptSetManager::Observer> |
| 311 user_script_set_manager_observer_; | 309 user_script_set_manager_observer_; |
| 312 | 310 |
| 313 // Status of webrequest usage. | |
| 314 bool webrequest_used_; | |
| 315 | |
| 316 // Whether or not extension activity is enabled. | 311 // Whether or not extension activity is enabled. |
| 317 bool activity_logging_enabled_; | 312 bool activity_logging_enabled_; |
| 318 | 313 |
| 319 // The WebView partition ID associated with this process's storage partition, | 314 // The WebView partition ID associated with this process's storage partition, |
| 320 // if this renderer is a WebView guest render process. Otherwise, this will be | 315 // if this renderer is a WebView guest render process. Otherwise, this will be |
| 321 // empty. | 316 // empty. |
| 322 std::string webview_partition_id_; | 317 std::string webview_partition_id_; |
| 323 | 318 |
| 324 DISALLOW_COPY_AND_ASSIGN(Dispatcher); | 319 DISALLOW_COPY_AND_ASSIGN(Dispatcher); |
| 325 }; | 320 }; |
| 326 | 321 |
| 327 } // namespace extensions | 322 } // namespace extensions |
| 328 | 323 |
| 329 #endif // EXTENSIONS_RENDERER_DISPATCHER_H_ | 324 #endif // EXTENSIONS_RENDERER_DISPATCHER_H_ |
| OLD | NEW |