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

Unified Diff: chrome/browser/chromeos/offline/offline_load_page.cc

Issue 349073004: Cleanup: Remove deprecated Profile::GetExtensionService(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typo Created 6 years, 6 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
Index: chrome/browser/chromeos/offline/offline_load_page.cc
diff --git a/chrome/browser/chromeos/offline/offline_load_page.cc b/chrome/browser/chromeos/offline/offline_load_page.cc
index 0937b5d8ff2fc202f1bf6b77b715d4763f97c515..4cf6339a72e6cbd1478274dc84f566d8b5c019eb 100644
--- a/chrome/browser/chromeos/offline/offline_load_page.cc
+++ b/chrome/browser/chromeos/offline/offline_load_page.cc
@@ -17,7 +17,6 @@
#include "base/values.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_preferences_util.h"
#include "chrome/browser/tab_contents/tab_util.h"
@@ -29,6 +28,7 @@
#include "content/public/browser/interstitial_page.h"
#include "content/public/browser/notification_types.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_icon_set.h"
@@ -80,14 +80,8 @@ std::string OfflineLoadPage::GetHTMLContents() {
Profile* profile = Profile::FromBrowserContext(
web_contents_->GetBrowserContext());
DCHECK(profile);
- const extensions::Extension* extension = NULL;
- ExtensionService* extensions_service =
- extensions::ExtensionSystem::Get(profile)->extension_service();
-
- // Extension service does not exist in test.
- if (extensions_service)
- extension = extensions_service->extensions()->GetHostedAppByURL(url_);
-
+ const extensions::Extension* extension = extensions::ExtensionRegistry::Get(
+ profile)->enabled_extensions().GetHostedAppByURL(url_);
if (extension && !extension->from_bookmark()) {
LocalizedError::GetAppErrorStrings(url_, extension, &error_strings);
resource_id = IDR_OFFLINE_APP_LOAD_HTML;
@@ -110,8 +104,8 @@ std::string OfflineLoadPage::GetHTMLContents() {
return webui::GetTemplatesHtml(template_html, &error_strings, "t");
}
- void OfflineLoadPage::OverrideRendererPrefs(
- content::RendererPreferences* prefs) {
+void OfflineLoadPage::OverrideRendererPrefs(
+ content::RendererPreferences* prefs) {
Profile* profile = Profile::FromBrowserContext(
web_contents_->GetBrowserContext());
renderer_preferences_util::UpdateFromSystemSettings(prefs, profile);
@@ -143,8 +137,10 @@ void OfflineLoadPage::CommandReceived(const std::string& cmd) {
} else if (command == "open_connectivity_diagnostics") {
Profile* profile = Profile::FromBrowserContext(
web_contents_->GetBrowserContext());
- const extensions::Extension* extension = profile->GetExtensionService()->
- GetInstalledExtension("kodldpbjkkmmnilagfdheibampofhaom");
+ const extensions::Extension* extension =
+ extensions::ExtensionRegistry::Get(profile)->GetExtensionById(
+ "kodldpbjkkmmnilagfdheibampofhaom",
+ extensions::ExtensionRegistry::EVERYTHING);
apps::LaunchPlatformAppWithUrl(profile, extension, "",
GURL::EmptyGURL(), GURL::EmptyGURL());
« no previous file with comments | « chrome/browser/chromeos/file_manager/file_tasks.cc ('k') | chrome/browser/profiles/off_the_record_profile_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698