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

Unified Diff: extensions/browser/extension_registry.h

Issue 125573002: Move ExtensionService::GetExtensionById() to ExtensionRegistry (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months 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 aedd11a434f8866ca2730c8cdbdc8a8e0e7968c5..2a3e8e808d3554baaa0ec11a917d5034fbfacaaf 100644
--- a/extensions/browser/extension_registry.h
+++ b/extensions/browser/extension_registry.h
@@ -24,6 +24,15 @@ class Extension;
// share a single registry.
class ExtensionRegistry : public BrowserContextKeyedService {
public:
+ enum IncludeFlag {
+ INCLUDE_NONE = 0,
+ INCLUDE_ENABLED = 1 << 0,
+ INCLUDE_DISABLED = 1 << 1,
+ INCLUDE_TERMINATED = 1 << 2,
+ INCLUDE_BLACKLISTED = 1 << 3,
+ INCLUDE_EVERYTHING = (1 << 4) - 1,
+ };
+
ExtensionRegistry();
virtual ~ExtensionRegistry();
@@ -45,6 +54,14 @@ class ExtensionRegistry : public BrowserContextKeyedService {
return blacklisted_extensions_;
}
+ // Look up an extension by ID, selecting which sets to look in:
+ // * enabled_extensions() --> INCLUDE_ENABLED
+ // * disabled_extensions() --> INCLUDE_DISABLED
+ // * terminated_extensions() --> INCLUDE_TERMINATED
+ // * blacklisted_extensions() --> INCLUDE_BLACKLISTED
+ const Extension* GetExtensionById(const std::string& id,
+ int include_mask) const;
+
// Adds the specified extension to the enabled set. The registry becomes an
// owner. Any previous extension with the same ID is removed.
// Returns true if there is no previous extension.

Powered by Google App Engine
This is Rietveld 408576698