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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 static ExtensionSystem* Get(Profile* profile); | 58 static ExtensionSystem* Get(Profile* profile); |
59 | 59 |
60 // ProfileKeyedService implementation. | 60 // ProfileKeyedService implementation. |
61 virtual void Shutdown() OVERRIDE {} | 61 virtual void Shutdown() OVERRIDE {} |
62 | 62 |
63 // Initializes extensions machinery. | 63 // Initializes extensions machinery. |
64 // Component extensions are always enabled, external and user extensions | 64 // Component extensions are always enabled, external and user extensions |
65 // are controlled by |extensions_enabled|. | 65 // are controlled by |extensions_enabled|. |
66 virtual void InitForRegularProfile(bool extensions_enabled) = 0; | 66 virtual void InitForRegularProfile(bool extensions_enabled) = 0; |
67 | 67 |
68 virtual void InitForOTRProfile() = 0; | |
69 | |
70 // The ExtensionService is created at startup. | 68 // The ExtensionService is created at startup. |
71 virtual ExtensionService* extension_service() = 0; | 69 virtual ExtensionService* extension_service() = 0; |
72 | 70 |
73 // The class controlling whether users are permitted to perform certain | 71 // The class controlling whether users are permitted to perform certain |
74 // actions on extensions (install, uninstall, disable, etc.). | 72 // actions on extensions (install, uninstall, disable, etc.). |
75 // The ManagementPolicy is created at startup. | 73 // The ManagementPolicy is created at startup. |
76 virtual ManagementPolicy* management_policy() = 0; | 74 virtual ManagementPolicy* management_policy() = 0; |
77 | 75 |
78 // The UserScriptMaster is created at startup. | 76 // The UserScriptMaster is created at startup. |
79 virtual UserScriptMaster* user_script_master() = 0; | 77 virtual UserScriptMaster* user_script_master() = 0; |
(...skipping 18 matching lines...) Expand all Loading... |
98 | 96 |
99 // Returns the IO-thread-accessible extension data. | 97 // Returns the IO-thread-accessible extension data. |
100 virtual ExtensionInfoMap* info_map() = 0; | 98 virtual ExtensionInfoMap* info_map() = 0; |
101 | 99 |
102 // The LazyBackgroundTaskQueue is created at startup. | 100 // The LazyBackgroundTaskQueue is created at startup. |
103 virtual LazyBackgroundTaskQueue* lazy_background_task_queue() = 0; | 101 virtual LazyBackgroundTaskQueue* lazy_background_task_queue() = 0; |
104 | 102 |
105 // The EventRouter is created at startup. | 103 // The EventRouter is created at startup. |
106 virtual EventRouter* event_router() = 0; | 104 virtual EventRouter* event_router() = 0; |
107 | 105 |
108 // The RulesRegistryService is created at startup. | |
109 virtual RulesRegistryService* rules_registry_service() = 0; | |
110 | |
111 // The SerialConnection ResourceManager is created at startup. | 106 // The SerialConnection ResourceManager is created at startup. |
112 virtual ApiResourceManager<SerialConnection>* | 107 virtual ApiResourceManager<SerialConnection>* |
113 serial_connection_manager() = 0; | 108 serial_connection_manager() = 0; |
114 | 109 |
115 // The Socket ResourceManager is created at startup. | 110 // The Socket ResourceManager is created at startup. |
116 virtual ApiResourceManager<Socket>* | 111 virtual ApiResourceManager<Socket>* |
117 socket_manager() = 0; | 112 socket_manager() = 0; |
118 | 113 |
119 // The UsbDeviceResource ResourceManager is created at startup. | 114 // The UsbDeviceResource ResourceManager is created at startup. |
120 virtual ApiResourceManager<UsbDeviceResource>* | 115 virtual ApiResourceManager<UsbDeviceResource>* |
(...skipping 28 matching lines...) Expand all Loading... |
149 // but with a shared instance for incognito) keeps the common services. | 144 // but with a shared instance for incognito) keeps the common services. |
150 class ExtensionSystemImpl : public ExtensionSystem { | 145 class ExtensionSystemImpl : public ExtensionSystem { |
151 public: | 146 public: |
152 explicit ExtensionSystemImpl(Profile* profile); | 147 explicit ExtensionSystemImpl(Profile* profile); |
153 virtual ~ExtensionSystemImpl(); | 148 virtual ~ExtensionSystemImpl(); |
154 | 149 |
155 // ProfileKeyedService implementation. | 150 // ProfileKeyedService implementation. |
156 virtual void Shutdown() OVERRIDE; | 151 virtual void Shutdown() OVERRIDE; |
157 | 152 |
158 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE; | 153 virtual void InitForRegularProfile(bool extensions_enabled) OVERRIDE; |
159 virtual void InitForOTRProfile() OVERRIDE; | |
160 | 154 |
161 virtual ExtensionService* extension_service() OVERRIDE; // shared | 155 virtual ExtensionService* extension_service() OVERRIDE; // shared |
162 virtual ManagementPolicy* management_policy() OVERRIDE; // shared | 156 virtual ManagementPolicy* management_policy() OVERRIDE; // shared |
163 virtual UserScriptMaster* user_script_master() OVERRIDE; // shared | 157 virtual UserScriptMaster* user_script_master() OVERRIDE; // shared |
164 virtual ExtensionProcessManager* process_manager() OVERRIDE; | 158 virtual ExtensionProcessManager* process_manager() OVERRIDE; |
165 virtual LocationManager* location_manager() OVERRIDE; | 159 virtual LocationManager* location_manager() OVERRIDE; |
166 virtual StateStore* state_store() OVERRIDE; // shared | 160 virtual StateStore* state_store() OVERRIDE; // shared |
167 virtual StateStore* rules_store() OVERRIDE; // shared | 161 virtual StateStore* rules_store() OVERRIDE; // shared |
168 virtual ExtensionPrefs* extension_prefs() OVERRIDE; // shared | 162 virtual ExtensionPrefs* extension_prefs() OVERRIDE; // shared |
169 virtual ShellWindowGeometryCache* shell_window_geometry_cache() | 163 virtual ShellWindowGeometryCache* shell_window_geometry_cache() |
170 OVERRIDE; // shared | 164 OVERRIDE; // shared |
171 virtual LazyBackgroundTaskQueue* lazy_background_task_queue() | 165 virtual LazyBackgroundTaskQueue* lazy_background_task_queue() |
172 OVERRIDE; // shared | 166 OVERRIDE; // shared |
173 virtual ExtensionInfoMap* info_map() OVERRIDE; // shared | 167 virtual ExtensionInfoMap* info_map() OVERRIDE; // shared |
174 virtual EventRouter* event_router() OVERRIDE; // shared | 168 virtual EventRouter* event_router() OVERRIDE; // shared |
175 virtual RulesRegistryService* rules_registry_service() | |
176 OVERRIDE; // shared | |
177 virtual ApiResourceManager<SerialConnection>* serial_connection_manager() | 169 virtual ApiResourceManager<SerialConnection>* serial_connection_manager() |
178 OVERRIDE; | 170 OVERRIDE; |
179 virtual ApiResourceManager<Socket>* socket_manager() OVERRIDE; | 171 virtual ApiResourceManager<Socket>* socket_manager() OVERRIDE; |
180 virtual ApiResourceManager<UsbDeviceResource>* usb_device_resource_manager() | 172 virtual ApiResourceManager<UsbDeviceResource>* usb_device_resource_manager() |
181 OVERRIDE; | 173 OVERRIDE; |
182 virtual ExtensionWarningService* warning_service() OVERRIDE; | 174 virtual ExtensionWarningService* warning_service() OVERRIDE; |
183 virtual Blacklist* blacklist() OVERRIDE; // shared | 175 virtual Blacklist* blacklist() OVERRIDE; // shared |
184 | 176 |
185 virtual void RegisterExtensionWithRequestContexts( | 177 virtual void RegisterExtensionWithRequestContexts( |
186 const Extension* extension) OVERRIDE; | 178 const Extension* extension) OVERRIDE; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 // |extension_process_manager_| must be destroyed before the Profile's | 250 // |extension_process_manager_| must be destroyed before the Profile's |
259 // |io_data_|. While |extension_process_manager_| still lives, we handle | 251 // |io_data_|. While |extension_process_manager_| still lives, we handle |
260 // incoming resource requests from extension processes and those require | 252 // incoming resource requests from extension processes and those require |
261 // access to the ResourceContext owned by |io_data_|. | 253 // access to the ResourceContext owned by |io_data_|. |
262 scoped_ptr<ExtensionProcessManager> extension_process_manager_; | 254 scoped_ptr<ExtensionProcessManager> extension_process_manager_; |
263 scoped_ptr<LocationManager> location_manager_; | 255 scoped_ptr<LocationManager> location_manager_; |
264 scoped_ptr<ApiResourceManager<SerialConnection> > serial_connection_manager_; | 256 scoped_ptr<ApiResourceManager<SerialConnection> > serial_connection_manager_; |
265 scoped_ptr<ApiResourceManager<Socket> > socket_manager_; | 257 scoped_ptr<ApiResourceManager<Socket> > socket_manager_; |
266 scoped_ptr<ApiResourceManager< | 258 scoped_ptr<ApiResourceManager< |
267 UsbDeviceResource> > usb_device_resource_manager_; | 259 UsbDeviceResource> > usb_device_resource_manager_; |
268 scoped_ptr<RulesRegistryService> rules_registry_service_; | |
269 | 260 |
270 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); | 261 DISALLOW_COPY_AND_ASSIGN(ExtensionSystemImpl); |
271 }; | 262 }; |
272 | 263 |
273 } // namespace extensions | 264 } // namespace extensions |
274 | 265 |
275 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_ | 266 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_H_ |
OLD | NEW |