| 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 "base/time/default_clock.h" | |
| 13 #include "chrome/browser/extensions/api/api_resource_manager.h" | 12 #include "chrome/browser/extensions/api/api_resource_manager.h" |
| 14 #include "chrome/browser/extensions/api/serial/serial_connection.h" | 13 #include "chrome/browser/extensions/api/serial/serial_connection.h" |
| 15 #include "chrome/browser/extensions/api/socket/socket.h" | 14 #include "chrome/browser/extensions/api/socket/socket.h" |
| 16 #include "chrome/browser/extensions/api/usb/usb_device_resource.h" | 15 #include "chrome/browser/extensions/api/usb/usb_device_resource.h" |
| 17 #include "chrome/browser/profiles/profile_keyed_service.h" | 16 #include "chrome/browser/profiles/profile_keyed_service.h" |
| 18 #include "chrome/common/extensions/extension_constants.h" | 17 #include "chrome/common/extensions/extension_constants.h" |
| 19 | 18 |
| 20 class ExtensionInfoMap; | 19 class ExtensionInfoMap; |
| 21 class ExtensionProcessManager; | 20 class ExtensionProcessManager; |
| 22 class ExtensionService; | 21 class ExtensionService; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // actions on extensions (install, uninstall, disable, etc.). | 73 // actions on extensions (install, uninstall, disable, etc.). |
| 75 // The ManagementPolicy is created at startup. | 74 // The ManagementPolicy is created at startup. |
| 76 virtual ManagementPolicy* management_policy() = 0; | 75 virtual ManagementPolicy* management_policy() = 0; |
| 77 | 76 |
| 78 // The UserScriptMaster is created at startup. | 77 // The UserScriptMaster is created at startup. |
| 79 virtual UserScriptMaster* user_script_master() = 0; | 78 virtual UserScriptMaster* user_script_master() = 0; |
| 80 | 79 |
| 81 // The ExtensionProcessManager is created at startup. | 80 // The ExtensionProcessManager is created at startup. |
| 82 virtual ExtensionProcessManager* process_manager() = 0; | 81 virtual ExtensionProcessManager* process_manager() = 0; |
| 83 | 82 |
| 84 // The AlarmManager is created at startup. | |
| 85 virtual AlarmManager* alarm_manager() = 0; | |
| 86 | |
| 87 // The StateStore is created at startup. | 83 // The StateStore is created at startup. |
| 88 virtual StateStore* state_store() = 0; | 84 virtual StateStore* state_store() = 0; |
| 89 | 85 |
| 90 // The rules store is created at startup. | 86 // The rules store is created at startup. |
| 91 virtual StateStore* rules_store() = 0; | 87 virtual StateStore* rules_store() = 0; |
| 92 | 88 |
| 93 // The extension prefs. | 89 // The extension prefs. |
| 94 virtual ExtensionPrefs* extension_prefs() = 0; | 90 virtual ExtensionPrefs* extension_prefs() = 0; |
| 95 | 91 |
| 96 // The ShellWindowGeometryCache is created at startup. | 92 // The ShellWindowGeometryCache is created at startup. |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 // ProfileKeyedService implementation. | 154 // ProfileKeyedService implementation. |
| 159 virtual void Shutdown() OVERRIDE; | 155 virtual void Shutdown() OVERRIDE; |
| 160 | 156 |
| 161 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE; | 157 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE; |
| 162 virtual void InitForOTRProfile() OVERRIDE; | 158 virtual void InitForOTRProfile() OVERRIDE; |
| 163 | 159 |
| 164 virtual ExtensionService* extension_service() OVERRIDE; // shared | 160 virtual ExtensionService* extension_service() OVERRIDE; // shared |
| 165 virtual ManagementPolicy* management_policy() OVERRIDE; // shared | 161 virtual ManagementPolicy* management_policy() OVERRIDE; // shared |
| 166 virtual UserScriptMaster* user_script_master() OVERRIDE; // shared | 162 virtual UserScriptMaster* user_script_master() OVERRIDE; // shared |
| 167 virtual ExtensionProcessManager* process_manager() OVERRIDE; | 163 virtual ExtensionProcessManager* process_manager() OVERRIDE; |
| 168 virtual AlarmManager* alarm_manager() OVERRIDE; | |
| 169 virtual StateStore* state_store() OVERRIDE; // shared | 164 virtual StateStore* state_store() OVERRIDE; // shared |
| 170 virtual StateStore* rules_store() OVERRIDE; // shared | 165 virtual StateStore* rules_store() OVERRIDE; // shared |
| 171 virtual ExtensionPrefs* extension_prefs() OVERRIDE; // shared | 166 virtual ExtensionPrefs* extension_prefs() OVERRIDE; // shared |
| 172 virtual ShellWindowGeometryCache* shell_window_geometry_cache() | 167 virtual ShellWindowGeometryCache* shell_window_geometry_cache() |
| 173 OVERRIDE; // shared | 168 OVERRIDE; // shared |
| 174 virtual LazyBackgroundTaskQueue* lazy_background_task_queue() | 169 virtual LazyBackgroundTaskQueue* lazy_background_task_queue() |
| 175 OVERRIDE; // shared | 170 OVERRIDE; // shared |
| 176 virtual ExtensionInfoMap* info_map() OVERRIDE; // shared | 171 virtual ExtensionInfoMap* info_map() OVERRIDE; // shared |
| 177 virtual MessageService* message_service() OVERRIDE; // shared | 172 virtual MessageService* message_service() OVERRIDE; // shared |
| 178 virtual EventRouter* event_router() OVERRIDE; // shared | 173 virtual EventRouter* event_router() OVERRIDE; // shared |
| (...skipping 26 matching lines...) Expand all Loading... |
| 205 | 200 |
| 206 // Initialization takes place in phases. | 201 // Initialization takes place in phases. |
| 207 virtual void InitPrefs(); | 202 virtual void InitPrefs(); |
| 208 // This must not be called until all the providers have been created. | 203 // This must not be called until all the providers have been created. |
| 209 void RegisterManagementPolicyProviders(); | 204 void RegisterManagementPolicyProviders(); |
| 210 void Init(bool extensions_enabled); | 205 void Init(bool extensions_enabled); |
| 211 | 206 |
| 212 // ProfileKeyedService implementation. | 207 // ProfileKeyedService implementation. |
| 213 virtual void Shutdown() OVERRIDE; | 208 virtual void Shutdown() OVERRIDE; |
| 214 | 209 |
| 215 base::Clock* clock(); | |
| 216 StateStore* state_store(); | 210 StateStore* state_store(); |
| 217 StateStore* rules_store(); | 211 StateStore* rules_store(); |
| 218 ExtensionPrefs* extension_prefs(); | 212 ExtensionPrefs* extension_prefs(); |
| 219 ShellWindowGeometryCache* shell_window_geometry_cache(); | 213 ShellWindowGeometryCache* shell_window_geometry_cache(); |
| 220 ExtensionService* extension_service(); | 214 ExtensionService* extension_service(); |
| 221 ManagementPolicy* management_policy(); | 215 ManagementPolicy* management_policy(); |
| 222 UserScriptMaster* user_script_master(); | 216 UserScriptMaster* user_script_master(); |
| 223 Blacklist* blacklist(); | 217 Blacklist* blacklist(); |
| 224 ExtensionInfoMap* info_map(); | 218 ExtensionInfoMap* info_map(); |
| 225 LazyBackgroundTaskQueue* lazy_background_task_queue(); | 219 LazyBackgroundTaskQueue* lazy_background_task_queue(); |
| 226 MessageService* message_service(); | 220 MessageService* message_service(); |
| 227 EventRouter* event_router(); | 221 EventRouter* event_router(); |
| 228 ExtensionWarningService* warning_service(); | 222 ExtensionWarningService* warning_service(); |
| 229 | 223 |
| 230 private: | 224 private: |
| 231 Profile* profile_; | 225 Profile* profile_; |
| 232 | 226 |
| 233 // The services that are shared between normal and incognito profiles. | 227 // The services that are shared between normal and incognito profiles. |
| 234 | 228 |
| 235 base::DefaultClock clock_; | |
| 236 scoped_ptr<StateStore> state_store_; | 229 scoped_ptr<StateStore> state_store_; |
| 237 scoped_ptr<StateStore> rules_store_; | 230 scoped_ptr<StateStore> rules_store_; |
| 238 scoped_ptr<ExtensionPrefs> extension_prefs_; | 231 scoped_ptr<ExtensionPrefs> extension_prefs_; |
| 239 // ShellWindowGeometryCache depends on ExtensionPrefs. | 232 // ShellWindowGeometryCache depends on ExtensionPrefs. |
| 240 scoped_ptr<ShellWindowGeometryCache> shell_window_geometry_cache_; | 233 scoped_ptr<ShellWindowGeometryCache> shell_window_geometry_cache_; |
| 241 // LazyBackgroundTaskQueue is a dependency of | 234 // LazyBackgroundTaskQueue is a dependency of |
| 242 // MessageService and EventRouter. | 235 // MessageService and EventRouter. |
| 243 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_; | 236 scoped_ptr<LazyBackgroundTaskQueue> lazy_background_task_queue_; |
| 244 scoped_ptr<EventRouter> event_router_; | 237 scoped_ptr<EventRouter> event_router_; |
| 245 scoped_ptr<MessageService> message_service_; | 238 scoped_ptr<MessageService> message_service_; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 261 | 254 |
| 262 Profile* profile_; | 255 Profile* profile_; |
| 263 | 256 |
| 264 Shared* shared_; | 257 Shared* shared_; |
| 265 | 258 |
| 266 // |extension_process_manager_| must be destroyed before the Profile's | 259 // |extension_process_manager_| must be destroyed before the Profile's |
| 267 // |io_data_|. While |extension_process_manager_| still lives, we handle | 260 // |io_data_|. While |extension_process_manager_| still lives, we handle |
| 268 // incoming resource requests from extension processes and those require | 261 // incoming resource requests from extension processes and those require |
| 269 // access to the ResourceContext owned by |io_data_|. | 262 // access to the ResourceContext owned by |io_data_|. |
| 270 scoped_ptr<ExtensionProcessManager> extension_process_manager_; | 263 scoped_ptr<ExtensionProcessManager> extension_process_manager_; |
| 271 scoped_ptr<AlarmManager> alarm_manager_; | |
| 272 scoped_ptr<ApiResourceManager<SerialConnection> > serial_connection_manager_; | 264 scoped_ptr<ApiResourceManager<SerialConnection> > serial_connection_manager_; |
| 273 scoped_ptr<ApiResourceManager<Socket> > socket_manager_; | 265 scoped_ptr<ApiResourceManager<Socket> > socket_manager_; |
| 274 scoped_ptr<ApiResourceManager< | 266 scoped_ptr<ApiResourceManager< |
| 275 UsbDeviceResource> > usb_device_resource_manager_; | 267 UsbDeviceResource> > usb_device_resource_manager_; |
| 276 scoped_ptr<RulesRegistryService> rules_registry_service_; | 268 scoped_ptr<RulesRegistryService> rules_registry_service_; |
| 277 | 269 |
| 278 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); | 270 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); |
| 279 }; | 271 }; |
| 280 | 272 |
| 281 } // namespace extensions | 273 } // namespace extensions |
| 282 | 274 |
| 283 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_ | 275 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_ |
| OLD | NEW |