Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Unified Diff: extensions/browser/extension_registry.h

Issue 120863003: Convert ExtensionRegistry to a BrowserContextKeyedService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: extensions/browser/extension_registry.h
diff --git a/extensions/browser/extension_registry.h b/extensions/browser/extension_registry.h
index c051fbb6c6564b1007e766050dfb43e83752c9d0..aedd11a434f8866ca2730c8cdbdc8a8e0e7968c5 100644
--- a/extensions/browser/extension_registry.h
+++ b/extensions/browser/extension_registry.h
@@ -7,19 +7,28 @@
#include <string>
+#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
+#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
#include "extensions/common/extension_set.h"
+namespace content {
+class BrowserContext;
+}
+
namespace extensions {
class Extension;
// ExtensionRegistry holds sets of the installed extensions for a given
-// BrowserContext.
-// TODO(jamescook): Convert this to a BrowserContextKeyedService.
-class ExtensionRegistry {
+// BrowserContext. An incognito browser context and its master browser context
+// share a single registry.
+class ExtensionRegistry : public BrowserContextKeyedService {
public:
ExtensionRegistry();
- ~ExtensionRegistry();
+ virtual ~ExtensionRegistry();
+
+ // Returns the instance for the given |browser_context|.
+ static ExtensionRegistry* Get(content::BrowserContext* browser_context);
// NOTE: These sets are *eventually* mututally exclusive, but an extension can
// appear in two sets for short periods of time.
@@ -70,6 +79,9 @@ class ExtensionRegistry {
void SetDisabledModificationCallback(
const ExtensionSet::ModificationCallback& callback);
+ // BrowserContextKeyedService implementation:
+ virtual void Shutdown() OVERRIDE;
+
private:
// Extensions that are installed, enabled and not terminated.
ExtensionSet enabled_extensions_;

Powered by Google App Engine
This is Rietveld 408576698