summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorsudarsana.nagineni <sudarsana.nagineni@intel.com>2015-06-05 05:01:50 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-05 12:03:21 +0000
commitdb93178bcaaf7e99ebb18bd51fa99b2feaf47e1f (patch)
tree41b50793eda9887814b27394523799f6cd1eaf84 /extensions
parent76f36a8362a3e817cc3ec721d591f2f8878dc0c7 (diff)
downloadchromium_src-db93178bcaaf7e99ebb18bd51fa99b2feaf47e1f.zip
chromium_src-db93178bcaaf7e99ebb18bd51fa99b2feaf47e1f.tar.gz
chromium_src-db93178bcaaf7e99ebb18bd51fa99b2feaf47e1f.tar.bz2
[Extensions] Add GetInstalledExtension() method to ExtensionRegistry
This CL adds GetInstalledExtension() method to ExtensionRegistry and uses it instead of deprecated ExtensionService::GetInstalledExtension() in chrome/browser/ui/app_list/. Part of removing the deprecated GetInstalledExtension() call from the ExtensionService. BUG=489687 Review URL: https://codereview.chromium.org/1130353010 Cr-Commit-Position: refs/heads/master@{#333036}
Diffstat (limited to 'extensions')
-rw-r--r--extensions/browser/extension_registry.cc5
-rw-r--r--extensions/browser/extension_registry.h4
2 files changed, 9 insertions, 0 deletions
diff --git a/extensions/browser/extension_registry.cc b/extensions/browser/extension_registry.cc
index 65c8b5e..c59d635 100644
--- a/extensions/browser/extension_registry.cc
+++ b/extensions/browser/extension_registry.cc
@@ -132,6 +132,11 @@ const Extension* ExtensionRegistry::GetExtensionById(const std::string& id,
return NULL;
}
+const Extension* ExtensionRegistry::GetInstalledExtension(
+ const std::string& id) const {
+ return GetExtensionById(id, ExtensionRegistry::EVERYTHING);
+}
+
bool ExtensionRegistry::AddEnabled(
const scoped_refptr<const Extension>& extension) {
return enabled_extensions_.Insert(extension);
diff --git a/extensions/browser/extension_registry.h b/extensions/browser/extension_registry.h
index fa5b493..fb7a9a5 100644
--- a/extensions/browser/extension_registry.h
+++ b/extensions/browser/extension_registry.h
@@ -123,6 +123,10 @@ class ExtensionRegistry : public KeyedService {
const Extension* GetExtensionById(const std::string& id,
int include_mask) const;
+ // Looks up an extension by ID, regardless of whether it's enabled,
+ // disabled, blacklisted, or terminated.
+ const Extension* GetInstalledExtension(const std::string& id) 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.