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

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: rebase, add test, get_extension_by_id 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
« no previous file with comments | « chrome/browser/ui/extensions/application_launch.cc ('k') | extensions/browser/extension_registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_registry.h
diff --git a/extensions/browser/extension_registry.h b/extensions/browser/extension_registry.h
index aedd11a434f8866ca2730c8cdbdc8a8e0e7968c5..d878e61e84db8ec44e56741cad14925dd997c038 100644
--- a/extensions/browser/extension_registry.h
+++ b/extensions/browser/extension_registry.h
@@ -24,6 +24,16 @@ class Extension;
// share a single registry.
class ExtensionRegistry : public BrowserContextKeyedService {
public:
+ // Flags to pass to GetExtensionById() to select which sets to look in.
+ enum IncludeFlag {
+ NONE = 0,
+ ENABLED = 1 << 0,
+ DISABLED = 1 << 1,
+ TERMINATED = 1 << 2,
+ BLACKLISTED = 1 << 3,
+ EVERYTHING = (1 << 4) - 1,
+ };
+
ExtensionRegistry();
virtual ~ExtensionRegistry();
@@ -45,6 +55,15 @@ class ExtensionRegistry : public BrowserContextKeyedService {
return blacklisted_extensions_;
}
+ // Find an extension by ID using |include_mask| to pick the sets to search:
+ // * enabled_extensions() --> ExtensionRegistry::ENABLED
+ // * disabled_extensions() --> ExtensionRegistry::DISABLED
+ // * terminated_extensions() --> ExtensionRegistry::TERMINATED
+ // * blacklisted_extensions() --> ExtensionRegistry::BLACKLISTED
+ // Returns NULL if the extension is not found in the selected sets.
+ 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.
« no previous file with comments | « chrome/browser/ui/extensions/application_launch.cc ('k') | extensions/browser/extension_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698