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 <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 141 |
142 // Returns a list of (module name, resource id) pairs for the JS modules to | 142 // Returns a list of (module name, resource id) pairs for the JS modules to |
143 // add to the source map. | 143 // add to the source map. |
144 static std::vector<std::pair<std::string, int> > GetJsResources(); | 144 static std::vector<std::pair<std::string, int> > GetJsResources(); |
145 static void RegisterNativeHandlers(ModuleSystem* module_system, | 145 static void RegisterNativeHandlers(ModuleSystem* module_system, |
146 ScriptContext* context, | 146 ScriptContext* context, |
147 Dispatcher* dispatcher, | 147 Dispatcher* dispatcher, |
148 RequestSender* request_sender, | 148 RequestSender* request_sender, |
149 V8SchemaRegistry* v8_schema_registry); | 149 V8SchemaRegistry* v8_schema_registry); |
150 | 150 |
| 151 bool WasWebRequestUsedBySomeExtensions() const { return webrequest_used_; } |
| 152 |
151 private: | 153 private: |
152 friend class ::ChromeRenderViewTest; | 154 friend class ::ChromeRenderViewTest; |
153 FRIEND_TEST_ALL_PREFIXES(RendererPermissionsPolicyDelegateTest, | 155 FRIEND_TEST_ALL_PREFIXES(RendererPermissionsPolicyDelegateTest, |
154 CannotScriptWebstore); | 156 CannotScriptWebstore); |
155 | 157 |
156 // RenderProcessObserver implementation: | 158 // RenderProcessObserver implementation: |
157 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; | 159 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; |
158 virtual void WebKitInitialized() OVERRIDE; | 160 virtual void WebKitInitialized() OVERRIDE; |
159 virtual void IdleNotification() OVERRIDE; | 161 virtual void IdleNotification() OVERRIDE; |
160 virtual void OnRenderProcessShutdown() OVERRIDE; | 162 virtual void OnRenderProcessShutdown() OVERRIDE; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 std::map<int, int> port_to_tab_id_map_; | 306 std::map<int, int> port_to_tab_id_map_; |
305 | 307 |
306 // True once WebKit has been initialized (and it is therefore safe to poke). | 308 // True once WebKit has been initialized (and it is therefore safe to poke). |
307 bool is_webkit_initialized_; | 309 bool is_webkit_initialized_; |
308 | 310 |
309 // It is important for this to come after the ScriptInjectionManager, so that | 311 // It is important for this to come after the ScriptInjectionManager, so that |
310 // the observer is destroyed before the UserScriptSet. | 312 // the observer is destroyed before the UserScriptSet. |
311 ScopedObserver<UserScriptSetManager, UserScriptSetManager::Observer> | 313 ScopedObserver<UserScriptSetManager, UserScriptSetManager::Observer> |
312 user_script_set_manager_observer_; | 314 user_script_set_manager_observer_; |
313 | 315 |
| 316 // Status of webrequest usage. |
| 317 bool webrequest_used_; |
| 318 |
314 DISALLOW_COPY_AND_ASSIGN(Dispatcher); | 319 DISALLOW_COPY_AND_ASSIGN(Dispatcher); |
315 }; | 320 }; |
316 | 321 |
317 } // namespace extensions | 322 } // namespace extensions |
318 | 323 |
319 #endif // EXTENSIONS_RENDERER_DISPATCHER_H_ | 324 #endif // EXTENSIONS_RENDERER_DISPATCHER_H_ |
OLD | NEW |