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/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 class InfoMap; | 33 class InfoMap; |
34 class ManagementPolicy; | 34 class ManagementPolicy; |
35 class OneShotEvent; | 35 class OneShotEvent; |
36 class QuotaService; | 36 class QuotaService; |
37 class RuntimeData; | 37 class RuntimeData; |
38 class ServiceWorkerManager; | 38 class ServiceWorkerManager; |
39 class SharedUserScriptMaster; | 39 class SharedUserScriptMaster; |
40 class StateStore; | 40 class StateStore; |
41 class ValueStoreFactory; | 41 class ValueStoreFactory; |
42 | 42 |
| 43 namespace declarative_net_request { |
| 44 class RulesMonitor; |
| 45 } // namespace |
| 46 |
43 // 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 |
44 // 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. |
45 // 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 |
46 // their own right. | 50 // their own right. |
47 class ExtensionSystem : public KeyedService { | 51 class ExtensionSystem : public KeyedService { |
48 public: | 52 public: |
49 ExtensionSystem(); | 53 ExtensionSystem(); |
50 ~ExtensionSystem() override; | 54 ~ExtensionSystem() override; |
51 | 55 |
52 // Returns the instance for the given browser context, or NULL if none. | 56 // Returns the instance for the given browser context, or NULL if none. |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 virtual void UnregisterExtensionWithRequestContexts( | 114 virtual void UnregisterExtensionWithRequestContexts( |
111 const std::string& extension_id, | 115 const std::string& extension_id, |
112 const UnloadedExtensionReason reason) {} | 116 const UnloadedExtensionReason reason) {} |
113 | 117 |
114 // Signaled when the extension system has completed its startup tasks. | 118 // Signaled when the extension system has completed its startup tasks. |
115 virtual const OneShotEvent& ready() const = 0; | 119 virtual const OneShotEvent& ready() const = 0; |
116 | 120 |
117 // Returns the content verifier, if any. | 121 // Returns the content verifier, if any. |
118 virtual ContentVerifier* content_verifier() = 0; | 122 virtual ContentVerifier* content_verifier() = 0; |
119 | 123 |
| 124 // TODO do we need to provide access to rules_monitor. It is already installed |
| 125 // as an ExtensionRegistryObserver. |
| 126 virtual declarative_net_request::RulesMonitor* rules_monitor() = 0; |
| 127 |
120 // Get a set of extensions that depend on the given extension. | 128 // Get a set of extensions that depend on the given extension. |
121 // TODO(elijahtaylor): Move SharedModuleService out of chrome/browser | 129 // TODO(elijahtaylor): Move SharedModuleService out of chrome/browser |
122 // so it can be retrieved from ExtensionSystem directly. | 130 // so it can be retrieved from ExtensionSystem directly. |
123 virtual std::unique_ptr<ExtensionSet> GetDependentExtensions( | 131 virtual std::unique_ptr<ExtensionSet> GetDependentExtensions( |
124 const Extension* extension) = 0; | 132 const Extension* extension) = 0; |
125 | 133 |
126 // Install an updated version of |extension_id| with the version given in | 134 // Install an updated version of |extension_id| with the version given in |
127 // temp_dir. Ownership of |temp_dir| in the filesystem is transferred and | 135 // temp_dir. Ownership of |temp_dir| in the filesystem is transferred and |
128 // implementors of this function are responsible for cleaning it up on | 136 // implementors of this function are responsible for cleaning it up on |
129 // errors, etc. | 137 // errors, etc. |
130 virtual void InstallUpdate(const std::string& extension_id, | 138 virtual void InstallUpdate(const std::string& extension_id, |
131 const base::FilePath& temp_dir) = 0; | 139 const base::FilePath& temp_dir) = 0; |
132 }; | 140 }; |
133 | 141 |
134 } // namespace extensions | 142 } // namespace extensions |
135 | 143 |
136 #endif // EXTENSIONS_BROWSER_EXTENSION_SYSTEM_H_ | 144 #endif // EXTENSIONS_BROWSER_EXTENSION_SYSTEM_H_ |
OLD | NEW |