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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 static ExtensionSystem* Get(Profile* profile); | 59 static ExtensionSystem* Get(Profile* profile); |
60 | 60 |
61 // ProfileKeyedService implementation. | 61 // ProfileKeyedService implementation. |
62 virtual void Shutdown() OVERRIDE {} | 62 virtual void Shutdown() OVERRIDE {} |
63 | 63 |
64 // Initializes extensions machinery. | 64 // Initializes extensions machinery. |
65 // Component extensions are always enabled, external and user extensions | 65 // Component extensions are always enabled, external and user extensions |
66 // are controlled by |extensions_enabled|. | 66 // are controlled by |extensions_enabled|. |
67 virtual void InitForRegularProfile(bool extensions_enabled) = 0; | 67 virtual void InitForRegularProfile(bool extensions_enabled) = 0; |
68 | 68 |
69 virtual void InitForOTRProfile() = 0; | |
70 | |
71 // The ExtensionService is created at startup. | 69 // The ExtensionService is created at startup. |
72 virtual ExtensionService* extension_service() = 0; | 70 virtual ExtensionService* extension_service() = 0; |
73 | 71 |
74 // The class controlling whether users are permitted to perform certain | 72 // The class controlling whether users are permitted to perform certain |
75 // actions on extensions (install, uninstall, disable, etc.). | 73 // actions on extensions (install, uninstall, disable, etc.). |
76 // The ManagementPolicy is created at startup. | 74 // The ManagementPolicy is created at startup. |
77 virtual ManagementPolicy* management_policy() = 0; | 75 virtual ManagementPolicy* management_policy() = 0; |
78 | 76 |
79 // The UserScriptMaster is created at startup. | 77 // The UserScriptMaster is created at startup. |
80 virtual UserScriptMaster* user_script_master() = 0; | 78 virtual UserScriptMaster* user_script_master() = 0; |
(...skipping 24 matching lines...) Expand all Loading... | |
105 | 103 |
106 // The LazyBackgroundTaskQueue is created at startup. | 104 // The LazyBackgroundTaskQueue is created at startup. |
107 virtual LazyBackgroundTaskQueue* lazy_background_task_queue() = 0; | 105 virtual LazyBackgroundTaskQueue* lazy_background_task_queue() = 0; |
108 | 106 |
109 // The MessageService is created at startup. | 107 // The MessageService is created at startup. |
110 virtual MessageService* message_service() = 0; | 108 virtual MessageService* message_service() = 0; |
111 | 109 |
112 // The EventRouter is created at startup. | 110 // The EventRouter is created at startup. |
113 virtual EventRouter* event_router() = 0; | 111 virtual EventRouter* event_router() = 0; |
114 | 112 |
115 // The RulesRegistryService is created at startup. | |
116 virtual RulesRegistryService* rules_registry_service() = 0; | |
117 | |
118 // The SerialConnection ResourceManager is created at startup. | 113 // The SerialConnection ResourceManager is created at startup. |
119 virtual ApiResourceManager<SerialConnection>* | 114 virtual ApiResourceManager<SerialConnection>* |
120 serial_connection_manager() = 0; | 115 serial_connection_manager() = 0; |
121 | 116 |
122 // The Socket ResourceManager is created at startup. | 117 // The Socket ResourceManager is created at startup. |
123 virtual ApiResourceManager<Socket>* | 118 virtual ApiResourceManager<Socket>* |
124 socket_manager() = 0; | 119 socket_manager() = 0; |
125 | 120 |
126 // The UsbDeviceResource ResourceManager is created at startup. | 121 // The UsbDeviceResource ResourceManager is created at startup. |
127 virtual ApiResourceManager<UsbDeviceResource>* | 122 virtual ApiResourceManager<UsbDeviceResource>* |
(...skipping 28 matching lines...) Expand all Loading... | |
156 // but with a shared instance for incognito) keeps the common services. | 151 // but with a shared instance for incognito) keeps the common services. |
157 class ExtensionSystemImpl : public ExtensionSystem { | 152 class ExtensionSystemImpl : public ExtensionSystem { |
158 public: | 153 public: |
159 explicit ExtensionSystemImpl(Profile* profile); | 154 explicit ExtensionSystemImpl(Profile* profile); |
160 virtual ~ExtensionSystemImpl(); | 155 virtual ~ExtensionSystemImpl(); |
161 | 156 |
162 // ProfileKeyedService implementation. | 157 // ProfileKeyedService implementation. |
163 virtual void Shutdown() OVERRIDE; | 158 virtual void Shutdown() OVERRIDE; |
164 | 159 |
165 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE; | 160 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE; |
166 virtual void InitForOTRProfile() OVERRIDE; | |
167 | 161 |
168 virtual ExtensionService* extension_service() OVERRIDE; // shared | 162 virtual ExtensionService* extension_service() OVERRIDE; // shared |
169 virtual ManagementPolicy* management_policy() OVERRIDE; // shared | 163 virtual ManagementPolicy* management_policy() OVERRIDE; // shared |
170 virtual UserScriptMaster* user_script_master() OVERRIDE; // shared | 164 virtual UserScriptMaster* user_script_master() OVERRIDE; // shared |
171 virtual ExtensionProcessManager* process_manager() OVERRIDE; | 165 virtual ExtensionProcessManager* process_manager() OVERRIDE; |
172 virtual AlarmManager* alarm_manager() OVERRIDE; | 166 virtual AlarmManager* alarm_manager() OVERRIDE; |
173 virtual LocationManager* location_manager() OVERRIDE; | 167 virtual LocationManager* location_manager() OVERRIDE; |
174 virtual StateStore* state_store() OVERRIDE; // shared | 168 virtual StateStore* state_store() OVERRIDE; // shared |
175 virtual StateStore* rules_store() OVERRIDE; // shared | 169 virtual StateStore* rules_store() OVERRIDE; // shared |
176 virtual ExtensionPrefs* extension_prefs() OVERRIDE; // shared | 170 virtual ExtensionPrefs* extension_prefs() OVERRIDE; // shared |
177 virtual ShellWindowGeometryCache* shell_window_geometry_cache() | 171 virtual ShellWindowGeometryCache* shell_window_geometry_cache() |
178 OVERRIDE; // shared | 172 OVERRIDE; // shared |
179 virtual LazyBackgroundTaskQueue* lazy_background_task_queue() | 173 virtual LazyBackgroundTaskQueue* lazy_background_task_queue() |
180 OVERRIDE; // shared | 174 OVERRIDE; // shared |
181 virtual ExtensionInfoMap* info_map() OVERRIDE; // shared | 175 virtual ExtensionInfoMap* info_map() OVERRIDE; // shared |
182 virtual MessageService* message_service() OVERRIDE; // shared | 176 virtual MessageService* message_service() OVERRIDE; // shared |
183 virtual EventRouter* event_router() OVERRIDE; // shared | 177 virtual EventRouter* event_router() OVERRIDE; // shared |
184 virtual RulesRegistryService* rules_registry_service() | |
185 OVERRIDE; // shared | |
Yoyo Zhou
2013/04/26 03:49:02
This comment was out of date. It wasn't shared. Th
Patrick Riordan
2013/05/01 01:30:34
Done.
| |
186 virtual ApiResourceManager<SerialConnection>* serial_connection_manager() | 178 virtual ApiResourceManager<SerialConnection>* serial_connection_manager() |
187 OVERRIDE; | 179 OVERRIDE; |
188 virtual ApiResourceManager<Socket>* socket_manager() OVERRIDE; | 180 virtual ApiResourceManager<Socket>* socket_manager() OVERRIDE; |
189 virtual ApiResourceManager<UsbDeviceResource>* usb_device_resource_manager() | 181 virtual ApiResourceManager<UsbDeviceResource>* usb_device_resource_manager() |
190 OVERRIDE; | 182 OVERRIDE; |
191 virtual ExtensionWarningService* warning_service() OVERRIDE; | 183 virtual ExtensionWarningService* warning_service() OVERRIDE; |
192 virtual Blacklist* blacklist() OVERRIDE; // shared | 184 virtual Blacklist* blacklist() OVERRIDE; // shared |
193 | 185 |
194 virtual void RegisterExtensionWithRequestContexts( | 186 virtual void RegisterExtensionWithRequestContexts( |
195 const Extension* extension) OVERRIDE; | 187 const Extension* extension) OVERRIDE; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
272 // |io_data_|. While |extension_process_manager_| still lives, we handle | 264 // |io_data_|. While |extension_process_manager_| still lives, we handle |
273 // incoming resource requests from extension processes and those require | 265 // incoming resource requests from extension processes and those require |
274 // access to the ResourceContext owned by |io_data_|. | 266 // access to the ResourceContext owned by |io_data_|. |
275 scoped_ptr<ExtensionProcessManager> extension_process_manager_; | 267 scoped_ptr<ExtensionProcessManager> extension_process_manager_; |
276 scoped_ptr<AlarmManager> alarm_manager_; | 268 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_; | |
283 | 274 |
284 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); | 275 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); |
285 }; | 276 }; |
286 | 277 |
287 } // namespace extensions | 278 } // namespace extensions |
288 | 279 |
289 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_ | 280 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_ |
OLD | NEW |