Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_REGISTRY_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_REGISTRY_H_ |
| 6 #define EXTENSIONS_BROWSER_EXTENSION_REGISTRY_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSION_REGISTRY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
| 14 #include "base/version.h" | 14 #include "base/version.h" |
| 15 #include "components/keyed_service/core/keyed_service.h" | 15 #include "components/keyed_service/core/keyed_service.h" |
| 16 #include "extensions/browser/events/lazy_event_dispatch_util.h" | |
| 16 #include "extensions/browser/uninstall_reason.h" | 17 #include "extensions/browser/uninstall_reason.h" |
| 17 #include "extensions/common/extension_set.h" | 18 #include "extensions/common/extension_set.h" |
| 18 #include "extensions/features/features.h" | 19 #include "extensions/features/features.h" |
| 19 | 20 |
| 20 #if !BUILDFLAG(ENABLE_EXTENSIONS) | 21 #if !BUILDFLAG(ENABLE_EXTENSIONS) |
| 21 #error "Extensions must be enabled" | 22 #error "Extensions must be enabled" |
| 22 #endif | 23 #endif |
| 23 | 24 |
| 24 namespace content { | 25 namespace content { |
| 25 class BrowserContext; | 26 class BrowserContext; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 174 // As above, but for the ready set. | 175 // As above, but for the ready set. |
| 175 bool AddReady(const scoped_refptr<const Extension>& extension); | 176 bool AddReady(const scoped_refptr<const Extension>& extension); |
| 176 bool RemoveReady(const std::string& id); | 177 bool RemoveReady(const std::string& id); |
| 177 | 178 |
| 178 // Removes all extensions from all sets. | 179 // Removes all extensions from all sets. |
| 179 void ClearAll(); | 180 void ClearAll(); |
| 180 | 181 |
| 181 // KeyedService implementation: | 182 // KeyedService implementation: |
| 182 void Shutdown() override; | 183 void Shutdown() override; |
| 183 | 184 |
| 185 LazyEventDispatchUtil* lazy_event_dispatch_util(); | |
| 186 | |
| 184 private: | 187 private: |
| 185 // Extensions that are installed, enabled and not terminated. | 188 // Extensions that are installed, enabled and not terminated. |
| 186 ExtensionSet enabled_extensions_; | 189 ExtensionSet enabled_extensions_; |
| 187 | 190 |
| 188 // Extensions that are installed and disabled. | 191 // Extensions that are installed and disabled. |
| 189 ExtensionSet disabled_extensions_; | 192 ExtensionSet disabled_extensions_; |
| 190 | 193 |
| 191 // Extensions that are installed and terminated. | 194 // Extensions that are installed and terminated. |
| 192 ExtensionSet terminated_extensions_; | 195 ExtensionSet terminated_extensions_; |
| 193 | 196 |
| 194 // Extensions that are installed and blacklisted. Generally these shouldn't be | 197 // Extensions that are installed and blacklisted. Generally these shouldn't be |
| 195 // considered as installed by the extension platform: we only keep them around | 198 // considered as installed by the extension platform: we only keep them around |
| 196 // so that if extensions are blacklisted by mistake they can easily be | 199 // so that if extensions are blacklisted by mistake they can easily be |
| 197 // un-blacklisted. | 200 // un-blacklisted. |
| 198 ExtensionSet blacklisted_extensions_; | 201 ExtensionSet blacklisted_extensions_; |
| 199 | 202 |
| 200 // Extensions that are installed and blocked. Will never be loaded. | 203 // Extensions that are installed and blocked. Will never be loaded. |
| 201 ExtensionSet blocked_extensions_; | 204 ExtensionSet blocked_extensions_; |
| 202 | 205 |
| 203 // Extensions that are ready for execution. This set is a non-exclusive | 206 // Extensions that are ready for execution. This set is a non-exclusive |
| 204 // subset of |enabled_extensions_|. | 207 // subset of |enabled_extensions_|. |
| 205 ExtensionSet ready_extensions_; | 208 ExtensionSet ready_extensions_; |
| 206 | 209 |
| 210 content::BrowserContext* const browser_context_; | |
| 211 | |
| 212 std::unique_ptr<LazyEventDispatchUtil> lazy_event_dispatch_util_; | |
|
Devlin
2017/05/23 21:30:36
I think this would be better placed on EventRouter
lazyboy
2017/05/23 23:19:08
Done.
| |
| 213 | |
| 207 base::ObserverList<ExtensionRegistryObserver> observers_; | 214 base::ObserverList<ExtensionRegistryObserver> observers_; |
| 208 | 215 |
| 209 content::BrowserContext* const browser_context_; | |
| 210 | |
| 211 DISALLOW_COPY_AND_ASSIGN(ExtensionRegistry); | 216 DISALLOW_COPY_AND_ASSIGN(ExtensionRegistry); |
| 212 }; | 217 }; |
| 213 | 218 |
| 214 } // namespace extensions | 219 } // namespace extensions |
| 215 | 220 |
| 216 #endif // EXTENSIONS_BROWSER_EXTENSION_REGISTRY_H_ | 221 #endif // EXTENSIONS_BROWSER_EXTENSION_REGISTRY_H_ |
| OLD | NEW |