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

Unified Diff: chrome/browser/ui/extensions/application_launch.cc

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/themes/theme_service_unittest.cc ('k') | extensions/browser/extension_registry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/extensions/application_launch.cc
diff --git a/chrome/browser/ui/extensions/application_launch.cc b/chrome/browser/ui/extensions/application_launch.cc
index 54617d32da1b20410f89e04fe435ce4302c17984..fbc7ed365f47c2e4f90528f6bb0944a8d7e454bf 100644
--- a/chrome/browser/ui/extensions/application_launch.cc
+++ b/chrome/browser/ui/extensions/application_launch.cc
@@ -39,6 +39,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "content/public/common/renderer_preferences.h"
+#include "extensions/browser/extension_registry.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
#include "grit/generated_resources.h"
@@ -57,6 +58,7 @@
using content::WebContents;
using extensions::Extension;
using extensions::ExtensionPrefs;
+using extensions::ExtensionRegistry;
namespace {
@@ -121,15 +123,11 @@ class EnableViaAppListFlow : public ExtensionEnableFlowDelegate {
const Extension* GetExtension(const AppLaunchParams& params) {
if (params.extension_id.empty())
return NULL;
- ExtensionService* service =
- extensions::ExtensionSystem::Get(params.profile)->extension_service();
- const Extension* extension = service->GetExtensionById(
- params.extension_id,
- ExtensionService::INCLUDE_ENABLED | ExtensionService::INCLUDE_DISABLED |
- ExtensionService::INCLUDE_TERMINATED);
- if (!extension)
- extension = service->GetTerminatedExtension(params.extension_id);
- return extension;
+ ExtensionRegistry* registry = ExtensionRegistry::Get(params.profile);
+ return registry->GetExtensionById(params.extension_id,
+ ExtensionRegistry::ENABLED |
+ ExtensionRegistry::DISABLED |
+ ExtensionRegistry::TERMINATED);
}
// Get the launch URL for a given extension, with optional override/fallback.
« no previous file with comments | « chrome/browser/themes/theme_service_unittest.cc ('k') | extensions/browser/extension_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698