summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorrdevlin.cronin@chromium.org <rdevlin.cronin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-10 21:00:37 +0000
committerrdevlin.cronin@chromium.org <rdevlin.cronin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-10 21:00:37 +0000
commitd685c565b865c157275a53800978cce8d40009bc (patch)
tree3159d56c46cf220b615bdc4df872862f41e60e1c /extensions
parent1845a7f44e8900e2378aaa542fe4f820dfa9473d (diff)
downloadchromium_src-d685c565b865c157275a53800978cce8d40009bc.zip
chromium_src-d685c565b865c157275a53800978cce8d40009bc.tar.gz
chromium_src-d685c565b865c157275a53800978cce8d40009bc.tar.bz2
Remove ExtensionService::GetInstalledApp() and ExtensionService::IsInstalledApp()
Move GetInstalledApp() to ExtensionSet::GetAppByURL(). - More accurately named. - Forces callers to understand that they are only searching the given extension set (GetInstalledApp() implied it may have searched more than just enabled extensions). Remove IsInstalledApp(), since this was used in only two places and can be substituted with GetAppByUrl() != NULL. BUG=351891 TBR=dzhioev@chromium.org (c/b/chromeos/first_run/) TBR=kinuko@chromium.org (c/b/sync_file_system/) TBR=nick@chromium.org (c/b/task_manager/) (All TBRs are for strictly mechanical changes) Review URL: https://codereview.chromium.org/218683011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263075 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions')
-rw-r--r--extensions/common/extension_set.cc5
-rw-r--r--extensions/common/extension_set.h5
2 files changed, 10 insertions, 0 deletions
diff --git a/extensions/common/extension_set.cc b/extensions/common/extension_set.cc
index 77d4491..c4c15d4 100644
--- a/extensions/common/extension_set.cc
+++ b/extensions/common/extension_set.cc
@@ -89,6 +89,11 @@ const Extension* ExtensionSet::GetExtensionOrAppByURL(const GURL& url) const {
return GetHostedAppByURL(url);
}
+const Extension* ExtensionSet::GetAppByURL(const GURL& url) const {
+ const Extension* extension = GetExtensionOrAppByURL(url);
+ return (extension && extension->is_app()) ? extension : NULL;
+}
+
const Extension* ExtensionSet::GetHostedAppByURL(const GURL& url) const {
for (ExtensionMap::const_iterator iter = extensions_.begin();
iter != extensions_.end(); ++iter) {
diff --git a/extensions/common/extension_set.h b/extensions/common/extension_set.h
index 4ba6530..6b41ae6 100644
--- a/extensions/common/extension_set.h
+++ b/extensions/common/extension_set.h
@@ -101,6 +101,11 @@ class ExtensionSet {
// EventBindings::HandleContextCreated)
const Extension* GetExtensionOrAppByURL(const GURL& url) const;
+ // Returns the app specified by the given |url|, if one exists. This will
+ // return NULL if there is no entry with |url|, or if the extension with
+ // |url| is not an app.
+ const Extension* GetAppByURL(const GURL& url) const;
+
// Returns the hosted app whose web extent contains the URL.
const Extension* GetHostedAppByURL(const GURL& url) const;