OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_BROWSER_EXTENSION_SYSTEM_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_SYSTEM_H_ |
6 #define EXTENSIONS_BROWSER_EXTENSION_SYSTEM_H_ | 6 #define EXTENSIONS_BROWSER_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 "components/keyed_service/core/keyed_service.h" | 11 #include "components/keyed_service/core/keyed_service.h" |
12 #include "extensions/common/extension.h" | 12 #include "extensions/common/extension.h" |
13 | 13 |
14 class ExtensionService; | 14 class ExtensionService; |
15 | 15 |
16 #if defined(OS_CHROMEOS) | 16 #if defined(OS_CHROMEOS) |
17 namespace chromeos { | 17 namespace chromeos { |
18 class DeviceLocalAccountManagementPolicyProvider; | 18 class DeviceLocalAccountManagementPolicyProvider; |
19 } | 19 } |
20 #endif // defined(OS_CHROMEOS) | 20 #endif // defined(OS_CHROMEOS) |
21 | 21 |
22 namespace content { | 22 namespace content { |
23 class BrowserContext; | 23 class BrowserContext; |
24 } | 24 } |
25 | 25 |
26 namespace extensions { | 26 namespace extensions { |
27 | 27 |
28 class Blacklist; | 28 class Blacklist; |
29 class ContentVerifier; | 29 class ContentVerifier; |
| 30 class DeclarativeUserScriptMaster; |
30 class ErrorConsole; | 31 class ErrorConsole; |
31 class EventRouter; | 32 class EventRouter; |
32 class Extension; | 33 class Extension; |
33 class ExtensionSet; | 34 class ExtensionSet; |
34 class ExtensionWarningService; | 35 class ExtensionWarningService; |
35 class InfoMap; | 36 class InfoMap; |
36 class InstallVerifier; | 37 class InstallVerifier; |
37 class LazyBackgroundTaskQueue; | 38 class LazyBackgroundTaskQueue; |
38 class ManagementPolicy; | 39 class ManagementPolicy; |
39 class OneShotEvent; | 40 class OneShotEvent; |
40 class ProcessManager; | 41 class ProcessManager; |
41 class QuotaService; | 42 class QuotaService; |
42 class RuntimeData; | 43 class RuntimeData; |
| 44 class SharedUserScriptMaster; |
43 class StateStore; | 45 class StateStore; |
44 class UserScriptMaster; | |
45 | 46 |
46 // ExtensionSystem manages the lifetime of many of the services used by the | 47 // ExtensionSystem manages the lifetime of many of the services used by the |
47 // extensions and apps system, and it handles startup and shutdown as needed. | 48 // extensions and apps system, and it handles startup and shutdown as needed. |
48 // Eventually, we'd like to make more of these services into KeyedServices in | 49 // Eventually, we'd like to make more of these services into KeyedServices in |
49 // their own right. | 50 // their own right. |
50 class ExtensionSystem : public KeyedService { | 51 class ExtensionSystem : public KeyedService { |
51 public: | 52 public: |
52 ExtensionSystem(); | 53 ExtensionSystem(); |
53 virtual ~ExtensionSystem(); | 54 virtual ~ExtensionSystem(); |
54 | 55 |
(...skipping 10 matching lines...) Expand all Loading... |
65 | 66 |
66 // Per-extension data that can change during the life of the process but | 67 // Per-extension data that can change during the life of the process but |
67 // does not persist across restarts. Lives on UI thread. Created at startup. | 68 // does not persist across restarts. Lives on UI thread. Created at startup. |
68 virtual RuntimeData* runtime_data() = 0; | 69 virtual RuntimeData* runtime_data() = 0; |
69 | 70 |
70 // The class controlling whether users are permitted to perform certain | 71 // The class controlling whether users are permitted to perform certain |
71 // actions on extensions (install, uninstall, disable, etc.). | 72 // actions on extensions (install, uninstall, disable, etc.). |
72 // The ManagementPolicy is created at startup. | 73 // The ManagementPolicy is created at startup. |
73 virtual ManagementPolicy* management_policy() = 0; | 74 virtual ManagementPolicy* management_policy() = 0; |
74 | 75 |
75 // The UserScriptMaster is created at startup. | 76 // The SharedUserScriptMaster is created at startup. |
76 virtual UserScriptMaster* user_script_master() = 0; | 77 virtual SharedUserScriptMaster* shared_user_script_master() = 0; |
77 | 78 |
78 // The ProcessManager is created at startup. | 79 // The ProcessManager is created at startup. |
79 virtual ProcessManager* process_manager() = 0; | 80 virtual ProcessManager* process_manager() = 0; |
80 | 81 |
81 // The StateStore is created at startup. | 82 // The StateStore is created at startup. |
82 virtual StateStore* state_store() = 0; | 83 virtual StateStore* state_store() = 0; |
83 | 84 |
84 // The rules store is created at startup. | 85 // The rules store is created at startup. |
85 virtual StateStore* rules_store() = 0; | 86 virtual StateStore* rules_store() = 0; |
86 | 87 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 virtual const OneShotEvent& ready() const = 0; | 129 virtual const OneShotEvent& ready() const = 0; |
129 | 130 |
130 // Returns the content verifier, if any. | 131 // Returns the content verifier, if any. |
131 virtual ContentVerifier* content_verifier() = 0; | 132 virtual ContentVerifier* content_verifier() = 0; |
132 | 133 |
133 // Get a set of extensions that depend on the given extension. | 134 // Get a set of extensions that depend on the given extension. |
134 // TODO(elijahtaylor): Move SharedModuleService out of chrome/browser | 135 // TODO(elijahtaylor): Move SharedModuleService out of chrome/browser |
135 // so it can be retrieved from ExtensionSystem directly. | 136 // so it can be retrieved from ExtensionSystem directly. |
136 virtual scoped_ptr<ExtensionSet> GetDependentExtensions( | 137 virtual scoped_ptr<ExtensionSet> GetDependentExtensions( |
137 const Extension* extension) = 0; | 138 const Extension* extension) = 0; |
| 139 |
| 140 // Get the user script master for declarative scripts, if any. |
| 141 virtual DeclarativeUserScriptMaster* |
| 142 GetDeclarativeUserScriptMasterByExtension( |
| 143 const ExtensionId& extension_id) = 0; |
138 }; | 144 }; |
139 | 145 |
140 } // namespace extensions | 146 } // namespace extensions |
141 | 147 |
142 #endif // EXTENSIONS_BROWSER_EXTENSION_SYSTEM_H_ | 148 #endif // EXTENSIONS_BROWSER_EXTENSION_SYSTEM_H_ |
OLD | NEW |