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_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "chrome/browser/extensions/api/api_resource_manager.h" | 12 #include "chrome/browser/extensions/api/api_resource_manager.h" |
13 #include "chrome/browser/extensions/api/serial/serial_connection.h" | 13 #include "chrome/browser/extensions/api/serial/serial_connection.h" |
14 #include "chrome/browser/extensions/api/socket/socket.h" | 14 #include "chrome/browser/extensions/api/socket/socket.h" |
15 #include "chrome/browser/extensions/api/usb/usb_device_resource.h" | 15 #include "chrome/browser/extensions/api/usb/usb_device_resource.h" |
16 #include "chrome/browser/profiles/profile_keyed_service.h" | 16 #include "chrome/browser/profiles/profile_keyed_service.h" |
17 #include "chrome/common/extensions/extension_constants.h" | 17 #include "chrome/common/extensions/extension_constants.h" |
18 | 18 |
19 class ExtensionDevToolsManager; | 19 class ExtensionDevToolsManager; |
20 class ExtensionInfoMap; | 20 class ExtensionInfoMap; |
21 class ExtensionNavigationObserver; | |
22 class ExtensionProcessManager; | 21 class ExtensionProcessManager; |
23 class ExtensionService; | 22 class ExtensionService; |
24 class Profile; | 23 class Profile; |
25 | 24 |
26 namespace extensions { | 25 namespace extensions { |
27 // Unfortunately, for the ApiResourceManager<> template classes, we don't seem | 26 // Unfortunately, for the ApiResourceManager<> template classes, we don't seem |
28 // to be able to forward-declare because of compilation errors on Windows. | 27 // to be able to forward-declare because of compilation errors on Windows. |
29 class AlarmManager; | 28 class AlarmManager; |
30 class EventRouter; | 29 class EventRouter; |
31 class Extension; | 30 class Extension; |
32 class ExtensionPrefs; | 31 class ExtensionPrefs; |
33 class ExtensionSystemSharedFactory; | 32 class ExtensionSystemSharedFactory; |
34 class LazyBackgroundTaskQueue; | 33 class LazyBackgroundTaskQueue; |
35 class ManagementPolicy; | 34 class ManagementPolicy; |
36 class MessageService; | 35 class MessageService; |
| 36 class NavigationObserver; |
37 class RulesRegistryService; | 37 class RulesRegistryService; |
38 class StateStore; | 38 class StateStore; |
39 class UserScriptMaster; | 39 class UserScriptMaster; |
40 | 40 |
41 // The ExtensionSystem manages the creation and destruction of services | 41 // The ExtensionSystem manages the creation and destruction of services |
42 // related to extensions. Most objects are shared between normal | 42 // related to extensions. Most objects are shared between normal |
43 // and incognito Profiles, except as called out in comments. | 43 // and incognito Profiles, except as called out in comments. |
44 // This interface supports using TestExtensionSystem for TestingProfiles | 44 // This interface supports using TestExtensionSystem for TestingProfiles |
45 // that don't want all of the extensions baggage in their tests. | 45 // that don't want all of the extensions baggage in their tests. |
46 class ExtensionSystem : public ProfileKeyedService { | 46 class ExtensionSystem : public ProfileKeyedService { |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 // ExtensionService depends on the 2 above. | 206 // ExtensionService depends on the 2 above. |
207 scoped_ptr<ExtensionService> extension_service_; | 207 scoped_ptr<ExtensionService> extension_service_; |
208 scoped_ptr<ManagementPolicy> management_policy_; | 208 scoped_ptr<ManagementPolicy> management_policy_; |
209 scoped_refptr<UserScriptMaster> user_script_master_; | 209 scoped_refptr<UserScriptMaster> user_script_master_; |
210 // extension_info_map_ needs to outlive extension_process_manager_. | 210 // extension_info_map_ needs to outlive extension_process_manager_. |
211 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 211 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
212 // This is a dependency of MessageService and EventRouter. | 212 // This is a dependency of MessageService and EventRouter. |
213 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_; | 213 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_; |
214 scoped_ptr<MessageService> message_service_; | 214 scoped_ptr<MessageService> message_service_; |
215 scoped_ptr<EventRouter> extension_event_router_; | 215 scoped_ptr<EventRouter> extension_event_router_; |
216 scoped_ptr<ExtensionNavigationObserver> extension_navigation_observer_; | 216 scoped_ptr<NavigationObserver> navigation_observer_; |
217 }; | 217 }; |
218 | 218 |
219 Profile* profile_; | 219 Profile* profile_; |
220 | 220 |
221 Shared* shared_; | 221 Shared* shared_; |
222 | 222 |
223 // The services that have their own instances in incognito. | 223 // The services that have their own instances in incognito. |
224 scoped_refptr<ExtensionDevToolsManager> extension_devtools_manager_; | 224 scoped_refptr<ExtensionDevToolsManager> extension_devtools_manager_; |
225 // |extension_process_manager_| must be destroyed before the Profile's | 225 // |extension_process_manager_| must be destroyed before the Profile's |
226 // |io_data_|. While |extension_process_manager_| still lives, we handle | 226 // |io_data_|. While |extension_process_manager_| still lives, we handle |
227 // incoming resource requests from extension processes and those require | 227 // incoming resource requests from extension processes and those require |
228 // access to the ResourceContext owned by |io_data_|. | 228 // access to the ResourceContext owned by |io_data_|. |
229 scoped_ptr<ExtensionProcessManager> extension_process_manager_; | 229 scoped_ptr<ExtensionProcessManager> extension_process_manager_; |
230 scoped_ptr<AlarmManager> alarm_manager_; | 230 scoped_ptr<AlarmManager> alarm_manager_; |
231 scoped_ptr<ApiResourceManager<SerialConnection> > serial_connection_manager_; | 231 scoped_ptr<ApiResourceManager<SerialConnection> > serial_connection_manager_; |
232 scoped_ptr<ApiResourceManager<Socket> > socket_manager_; | 232 scoped_ptr<ApiResourceManager<Socket> > socket_manager_; |
233 scoped_ptr<ApiResourceManager< | 233 scoped_ptr<ApiResourceManager< |
234 UsbDeviceResource> > usb_device_resource_manager_; | 234 UsbDeviceResource> > usb_device_resource_manager_; |
235 scoped_ptr<RulesRegistryService> rules_registry_service_; | 235 scoped_ptr<RulesRegistryService> rules_registry_service_; |
236 | 236 |
237 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); | 237 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); |
238 }; | 238 }; |
239 | 239 |
240 } // namespace extensions | 240 } // namespace extensions |
241 | 241 |
242 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_ | 242 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_ |
OLD | NEW |