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" |
(...skipping 12 matching lines...) Expand all Loading... |
23 class Profile; | 23 class Profile; |
24 | 24 |
25 namespace extensions { | 25 namespace extensions { |
26 // Unfortunately, for the ApiResourceManager<> template classes, we don't seem | 26 // Unfortunately, for the ApiResourceManager<> template classes, we don't seem |
27 // 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. |
28 class AlarmManager; | 28 class AlarmManager; |
29 class EventRouter; | 29 class EventRouter; |
30 class Extension; | 30 class Extension; |
31 class ExtensionPrefs; | 31 class ExtensionPrefs; |
32 class ExtensionSystemSharedFactory; | 32 class ExtensionSystemSharedFactory; |
| 33 class ImageLoader; |
33 class LazyBackgroundTaskQueue; | 34 class LazyBackgroundTaskQueue; |
34 class ManagementPolicy; | 35 class ManagementPolicy; |
35 class MessageService; | 36 class MessageService; |
36 class NavigationObserver; | 37 class NavigationObserver; |
37 class RulesRegistryService; | 38 class RulesRegistryService; |
38 class ShellWindowGeometryCache; | 39 class ShellWindowGeometryCache; |
39 class StateStore; | 40 class StateStore; |
40 class UserScriptMaster; | 41 class UserScriptMaster; |
41 | 42 |
42 // The ExtensionSystem manages the creation and destruction of services | 43 // The ExtensionSystem manages the creation and destruction of services |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 98 |
98 // The MessageService is created at startup. | 99 // The MessageService is created at startup. |
99 virtual MessageService* message_service() = 0; | 100 virtual MessageService* message_service() = 0; |
100 | 101 |
101 // The EventRouter is created at startup. | 102 // The EventRouter is created at startup. |
102 virtual EventRouter* event_router() = 0; | 103 virtual EventRouter* event_router() = 0; |
103 | 104 |
104 // The RulesRegistryService is created at startup. | 105 // The RulesRegistryService is created at startup. |
105 virtual RulesRegistryService* rules_registry_service() = 0; | 106 virtual RulesRegistryService* rules_registry_service() = 0; |
106 | 107 |
| 108 // Returns the ImageLoader that should be used to load extension images. |
| 109 virtual ImageLoader* image_loader() = 0; |
| 110 |
107 // The SerialConnection ResourceManager is created at startup. | 111 // The SerialConnection ResourceManager is created at startup. |
108 virtual ApiResourceManager<SerialConnection>* | 112 virtual ApiResourceManager<SerialConnection>* |
109 serial_connection_manager() = 0; | 113 serial_connection_manager() = 0; |
110 | 114 |
111 // The Socket ResourceManager is created at startup. | 115 // The Socket ResourceManager is created at startup. |
112 virtual ApiResourceManager<Socket>* | 116 virtual ApiResourceManager<Socket>* |
113 socket_manager() = 0; | 117 socket_manager() = 0; |
114 | 118 |
115 // The UsbDeviceResource ResourceManager is created at startup. | 119 // The UsbDeviceResource ResourceManager is created at startup. |
116 virtual ApiResourceManager<UsbDeviceResource>* | 120 virtual ApiResourceManager<UsbDeviceResource>* |
(...skipping 30 matching lines...) Expand all Loading... |
147 | 151 |
148 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE; | 152 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE; |
149 virtual void InitForOTRProfile() OVERRIDE; | 153 virtual void InitForOTRProfile() OVERRIDE; |
150 | 154 |
151 virtual ExtensionService* extension_service() OVERRIDE; // shared | 155 virtual ExtensionService* extension_service() OVERRIDE; // shared |
152 virtual ManagementPolicy* management_policy() OVERRIDE; // shared | 156 virtual ManagementPolicy* management_policy() OVERRIDE; // shared |
153 virtual UserScriptMaster* user_script_master() OVERRIDE; // shared | 157 virtual UserScriptMaster* user_script_master() OVERRIDE; // shared |
154 virtual ExtensionDevToolsManager* devtools_manager() OVERRIDE; | 158 virtual ExtensionDevToolsManager* devtools_manager() OVERRIDE; |
155 virtual ExtensionProcessManager* process_manager() OVERRIDE; | 159 virtual ExtensionProcessManager* process_manager() OVERRIDE; |
156 virtual AlarmManager* alarm_manager() OVERRIDE; | 160 virtual AlarmManager* alarm_manager() OVERRIDE; |
157 virtual StateStore* state_store() OVERRIDE; | 161 virtual StateStore* state_store() OVERRIDE; // shared |
158 virtual ShellWindowGeometryCache* shell_window_geometry_cache() OVERRIDE; | 162 virtual ShellWindowGeometryCache* shell_window_geometry_cache() |
| 163 OVERRIDE; // shared |
159 virtual LazyBackgroundTaskQueue* lazy_background_task_queue() | 164 virtual LazyBackgroundTaskQueue* lazy_background_task_queue() |
160 OVERRIDE; // shared | 165 OVERRIDE; // shared |
161 virtual ExtensionInfoMap* info_map() OVERRIDE; // shared | 166 virtual ExtensionInfoMap* info_map() OVERRIDE; // shared |
162 virtual MessageService* message_service() OVERRIDE; // shared | 167 virtual MessageService* message_service() OVERRIDE; // shared |
163 virtual EventRouter* event_router() OVERRIDE; // shared | 168 virtual EventRouter* event_router() OVERRIDE; // shared |
164 virtual RulesRegistryService* rules_registry_service() | 169 virtual RulesRegistryService* rules_registry_service() |
165 OVERRIDE; // shared | 170 OVERRIDE; // shared |
| 171 virtual ImageLoader* image_loader() OVERRIDE; // shared |
166 virtual ApiResourceManager<SerialConnection>* serial_connection_manager() | 172 virtual ApiResourceManager<SerialConnection>* serial_connection_manager() |
167 OVERRIDE; | 173 OVERRIDE; |
168 virtual ApiResourceManager<Socket>* socket_manager() OVERRIDE; | 174 virtual ApiResourceManager<Socket>* socket_manager() OVERRIDE; |
169 virtual ApiResourceManager<UsbDeviceResource>* usb_device_resource_manager() | 175 virtual ApiResourceManager<UsbDeviceResource>* usb_device_resource_manager() |
170 OVERRIDE; | 176 OVERRIDE; |
171 | 177 |
172 virtual void RegisterExtensionWithRequestContexts( | 178 virtual void RegisterExtensionWithRequestContexts( |
173 const Extension* extension) OVERRIDE; | 179 const Extension* extension) OVERRIDE; |
174 | 180 |
175 virtual void UnregisterExtensionWithRequestContexts( | 181 virtual void UnregisterExtensionWithRequestContexts( |
(...skipping 21 matching lines...) Expand all Loading... |
197 | 203 |
198 StateStore* state_store(); | 204 StateStore* state_store(); |
199 ShellWindowGeometryCache* shell_window_geometry_cache(); | 205 ShellWindowGeometryCache* shell_window_geometry_cache(); |
200 ExtensionService* extension_service(); | 206 ExtensionService* extension_service(); |
201 ManagementPolicy* management_policy(); | 207 ManagementPolicy* management_policy(); |
202 UserScriptMaster* user_script_master(); | 208 UserScriptMaster* user_script_master(); |
203 ExtensionInfoMap* info_map(); | 209 ExtensionInfoMap* info_map(); |
204 LazyBackgroundTaskQueue* lazy_background_task_queue(); | 210 LazyBackgroundTaskQueue* lazy_background_task_queue(); |
205 MessageService* message_service(); | 211 MessageService* message_service(); |
206 EventRouter* event_router(); | 212 EventRouter* event_router(); |
| 213 ImageLoader* image_loader(); |
207 | 214 |
208 private: | 215 private: |
209 Profile* profile_; | 216 Profile* profile_; |
210 | 217 |
211 // The services that are shared between normal and incognito profiles. | 218 // The services that are shared between normal and incognito profiles. |
212 | 219 |
213 scoped_ptr<StateStore> state_store_; | 220 scoped_ptr<StateStore> state_store_; |
214 scoped_ptr<ShellWindowGeometryCache> shell_window_geometry_cache_; | 221 scoped_ptr<ShellWindowGeometryCache> shell_window_geometry_cache_; |
215 scoped_ptr<ExtensionPrefs> extension_prefs_; | 222 scoped_ptr<ExtensionPrefs> extension_prefs_; |
216 // ExtensionService depends on the 2 above. | 223 // ExtensionService depends on the 2 above. |
217 scoped_ptr<ExtensionService> extension_service_; | 224 scoped_ptr<ExtensionService> extension_service_; |
218 scoped_ptr<ManagementPolicy> management_policy_; | 225 scoped_ptr<ManagementPolicy> management_policy_; |
219 scoped_refptr<UserScriptMaster> user_script_master_; | 226 scoped_refptr<UserScriptMaster> user_script_master_; |
220 // extension_info_map_ needs to outlive extension_process_manager_. | 227 // extension_info_map_ needs to outlive extension_process_manager_. |
221 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 228 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
222 // This is a dependency of MessageService and EventRouter. | 229 // This is a dependency of MessageService and EventRouter. |
223 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_; | 230 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_; |
224 scoped_ptr<MessageService> message_service_; | 231 scoped_ptr<MessageService> message_service_; |
225 scoped_ptr<EventRouter> extension_event_router_; | 232 scoped_ptr<EventRouter> extension_event_router_; |
| 233 scoped_ptr<ImageLoader> image_loader_; |
226 scoped_ptr<NavigationObserver> navigation_observer_; | 234 scoped_ptr<NavigationObserver> navigation_observer_; |
227 }; | 235 }; |
228 | 236 |
229 Profile* profile_; | 237 Profile* profile_; |
230 | 238 |
231 Shared* shared_; | 239 Shared* shared_; |
232 | 240 |
233 // The services that have their own instances in incognito. | 241 // The services that have their own instances in incognito. |
234 scoped_refptr<ExtensionDevToolsManager> extension_devtools_manager_; | 242 scoped_refptr<ExtensionDevToolsManager> extension_devtools_manager_; |
235 // |extension_process_manager_| must be destroyed before the Profile's | 243 // |extension_process_manager_| must be destroyed before the Profile's |
236 // |io_data_|. While |extension_process_manager_| still lives, we handle | 244 // |io_data_|. While |extension_process_manager_| still lives, we handle |
237 // incoming resource requests from extension processes and those require | 245 // incoming resource requests from extension processes and those require |
238 // access to the ResourceContext owned by |io_data_|. | 246 // access to the ResourceContext owned by |io_data_|. |
239 scoped_ptr<ExtensionProcessManager> extension_process_manager_; | 247 scoped_ptr<ExtensionProcessManager> extension_process_manager_; |
240 scoped_ptr<AlarmManager> alarm_manager_; | 248 scoped_ptr<AlarmManager> alarm_manager_; |
241 scoped_ptr<ApiResourceManager<SerialConnection> > serial_connection_manager_; | 249 scoped_ptr<ApiResourceManager<SerialConnection> > serial_connection_manager_; |
242 scoped_ptr<ApiResourceManager<Socket> > socket_manager_; | 250 scoped_ptr<ApiResourceManager<Socket> > socket_manager_; |
243 scoped_ptr<ApiResourceManager< | 251 scoped_ptr<ApiResourceManager< |
244 UsbDeviceResource> > usb_device_resource_manager_; | 252 UsbDeviceResource> > usb_device_resource_manager_; |
245 scoped_ptr<RulesRegistryService> rules_registry_service_; | 253 scoped_ptr<RulesRegistryService> rules_registry_service_; |
246 | 254 |
247 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); | 255 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); |
248 }; | 256 }; |
249 | 257 |
250 } // namespace extensions | 258 } // namespace extensions |
251 | 259 |
252 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_ | 260 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_ |
OLD | NEW |