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

Unified Diff: chrome/browser/ui/ash/launcher/launcher_app_tab_helper.cc

Issue 218683011: Remove ExtensionService::[Get|Is]InstalledApp() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dc_ces_get_installed_ext_by_url
Patch Set: Latest master Created 6 years, 9 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/task_manager/tab_contents_information.cc ('k') | chrome/browser/ui/browser_commands.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/launcher/launcher_app_tab_helper.cc
diff --git a/chrome/browser/ui/ash/launcher/launcher_app_tab_helper.cc b/chrome/browser/ui/ash/launcher/launcher_app_tab_helper.cc
index 862bccc8bba4ac7d57f3a0501e9024187f59151d..9da93cdbf63f0402c38582d09204c73f7691ad5b 100644
--- a/chrome/browser/ui/ash/launcher/launcher_app_tab_helper.cc
+++ b/chrome/browser/ui/ash/launcher/launcher_app_tab_helper.cc
@@ -18,36 +18,41 @@
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/extension_registry.h"
+#include "extensions/browser/extension_system.h"
#include "extensions/common/extension.h"
+#include "extensions/common/extension_set.h"
namespace {
const extensions::Extension* GetExtensionForTab(Profile* profile,
content::WebContents* tab) {
- ExtensionService* extension_service = profile->GetExtensionService();
- if (!extension_service || !extension_service->extensions_enabled())
+ if (!ExtensionSystem::Get(profile)->extension_service()->extensions_enabled())
sky 2014/04/04 21:21:13 We seem to have all sorts of code that NULL checks
Devlin 2014/04/04 21:24:14 ExtensionService can be null (in unittests, more t
return NULL;
Browser* browser = chrome::FindBrowserWithWebContents(tab);
DCHECK(browser);
+ extensions::ExtensionRegistry* registry =
+ extensions::ExtensionRegistry::Get(profile);
+
// Use the Browser's app name to determine the extension for app windows and
// use the tab's url for app tabs.
if (browser->is_app()) {
- return extension_service->GetInstalledExtension(
- web_app::GetExtensionIdFromApplicationName(browser->app_name()));
+ return registry->GetInstalledExtensionById(
+ web_app::GetExtensionIdFromApplicationName(browser->app_name()),
+ extensions::ExtensionRegistry::EVERYTHING);
}
const GURL url = tab->GetURL();
- if (extension_service->IsInstalledApp(url))
- return extension_service->GetInstalledApp(url);
+ const extensions::ExtensionSet& extensions = registry->enabled_extensions();
+ const Extension* extension = extensions.GetAppByURL(url);
+ if (extension)
+ return extension;
// Bookmark app windows should match their launch url extension despite
// their web extents.
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableStreamlinedHostedApps)) {
- const extensions::ExtensionSet& extensions =
- extensions::ExtensionRegistry::Get(profile)->enabled_extensions();
for (extensions::ExtensionSet::const_iterator it = extensions.begin();
it != extensions.end(); ++it) {
if (it->get()->from_bookmark() &&
« no previous file with comments | « chrome/browser/task_manager/tab_contents_information.cc ('k') | chrome/browser/ui/browser_commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698