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