| Index: extensions/browser/extension_registry.cc
|
| diff --git a/extensions/browser/extension_registry.cc b/extensions/browser/extension_registry.cc
|
| index f4bd91e145bff6c4387b74ba7f35614de5a94651..bc5247cdce2002d9cadaf121809d15f0bcbc8e59 100644
|
| --- a/extensions/browser/extension_registry.cc
|
| +++ b/extensions/browser/extension_registry.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "extensions/browser/extension_registry.h"
|
|
|
| +#include "base/strings/string_util.h"
|
| #include "extensions/browser/extension_registry_factory.h"
|
|
|
| namespace extensions {
|
| @@ -16,6 +17,32 @@ ExtensionRegistry* ExtensionRegistry::Get(content::BrowserContext* context) {
|
| return ExtensionRegistryFactory::GetForBrowserContext(context);
|
| }
|
|
|
| +const Extension* ExtensionRegistry::GetExtensionById(const std::string& id,
|
| + int include_mask) const {
|
| + std::string lowercase_id = StringToLowerASCII(id);
|
| + if (include_mask & ENABLED) {
|
| + const Extension* extension = enabled_extensions_.GetByID(lowercase_id);
|
| + if (extension)
|
| + return extension;
|
| + }
|
| + if (include_mask & DISABLED) {
|
| + const Extension* extension = disabled_extensions_.GetByID(lowercase_id);
|
| + if (extension)
|
| + return extension;
|
| + }
|
| + if (include_mask & TERMINATED) {
|
| + const Extension* extension = terminated_extensions_.GetByID(lowercase_id);
|
| + if (extension)
|
| + return extension;
|
| + }
|
| + if (include_mask & BLACKLISTED) {
|
| + const Extension* extension = blacklisted_extensions_.GetByID(lowercase_id);
|
| + if (extension)
|
| + return extension;
|
| + }
|
| + return NULL;
|
| +}
|
| +
|
| bool ExtensionRegistry::AddEnabled(
|
| const scoped_refptr<const Extension>& extension) {
|
| return enabled_extensions_.Insert(extension);
|
|
|