Index: chrome/browser/background/background_contents_service.cc |
diff --git a/chrome/browser/background/background_contents_service.cc b/chrome/browser/background/background_contents_service.cc |
index 3263305220191afaa31fe0bc9dd895ba778c9fa7..cf9071bbd5040d4839acb9219ad9ba3c70f84511 100644 |
--- a/chrome/browser/background/background_contents_service.cc |
+++ b/chrome/browser/background/background_contents_service.cc |
@@ -15,6 +15,7 @@ |
#include "chrome/browser/browser_process.h" |
#include "chrome/browser/extensions/extension_host.h" |
#include "chrome/browser/extensions/extension_service.h" |
+#include "chrome/browser/extensions/extension_system.h" |
#include "chrome/browser/notifications/desktop_notification_service.h" |
#include "chrome/browser/notifications/notification.h" |
#include "chrome/browser/notifications/notification_ui_manager.h" |
@@ -82,7 +83,8 @@ class CrashNotificationDelegate : public NotificationDelegate { |
if (!service->GetAppBackgroundContents(ASCIIToUTF16(extension_id_))) |
service->LoadBackgroundContentsForExtension(profile_, extension_id_); |
} else { |
- profile_->GetExtensionService()->ReloadExtension(extension_id_); |
+ extensions::ExtensionSystem::Get(profile_)->extension_service()-> |
+ ReloadExtension(extension_id_); |
} |
// Closing the balloon here should be OK, but it causes a crash on Mac |
@@ -250,7 +252,8 @@ void BackgroundContentsService::Observe( |
content::Details<BackgroundContents>(details).ptr(); |
Profile* profile = content::Source<Profile>(source).ptr(); |
const string16& appid = GetParentApplicationId(bgcontents); |
- ExtensionService* extension_service = profile->GetExtensionService(); |
+ ExtensionService* extension_service = |
+ extensions::ExtensionSystem::Get(profile)->extension_service(); |
// extension_service can be NULL when running tests. |
if (extension_service) { |
const Extension* extension = |
@@ -271,7 +274,8 @@ void BackgroundContentsService::Observe( |
// app, then blow away registered urls in the pref. |
ShutdownAssociatedBackgroundContents(ASCIIToUTF16(extension->id())); |
- ExtensionService* service = profile->GetExtensionService(); |
+ ExtensionService* service = |
+ extensions::ExtensionSystem::Get(profile)->extension_service(); |
if (service && service->is_ready()) { |
// Now load the manifest-specified background page. If service isn't |
// ready, then the background page will be loaded from the |
@@ -297,7 +301,8 @@ void BackgroundContentsService::Observe( |
BackgroundContentsServiceFactory::GetForProfile(profile)-> |
GetParentApplicationId(bg)); |
extension = |
- profile->GetExtensionService()->GetExtensionById(extension_id, false); |
+ extensions::ExtensionSystem::Get(profile)->extension_service()-> |
+ GetExtensionById(extension_id, false); |
} else { |
extensions::ExtensionHost* extension_host = |
content::Details<extensions::ExtensionHost>(details).ptr(); |
@@ -369,7 +374,8 @@ void BackgroundContentsService::LoadBackgroundContentsFromPrefs( |
prefs_->GetDictionary(prefs::kRegisteredBackgroundContents); |
if (!contents) |
return; |
- ExtensionService* extensions_service = profile->GetExtensionService(); |
+ ExtensionService* extensions_service = |
+ extensions::ExtensionSystem::Get(profile)->extension_service(); |
DCHECK(extensions_service); |
for (DictionaryValue::key_iterator it = contents->begin_keys(); |
it != contents->end_keys(); ++it) { |
@@ -404,7 +410,8 @@ void BackgroundContentsService::LoadBackgroundContentsForExtension( |
const std::string& extension_id) { |
// First look if the manifest specifies a background page. |
const Extension* extension = |
- profile->GetExtensionService()->GetExtensionById(extension_id, false); |
+ extensions::ExtensionSystem::Get(profile)->extension_service()-> |
+ GetExtensionById(extension_id, false); |
DCHECK(!extension || extension->is_hosted_app()); |
if (extension && extension->has_background_page()) { |
LoadBackgroundContents(profile, |
@@ -428,7 +435,8 @@ void BackgroundContentsService::LoadBackgroundContentsFromDictionary( |
Profile* profile, |
const std::string& extension_id, |
const DictionaryValue* contents) { |
- ExtensionService* extensions_service = profile->GetExtensionService(); |
+ ExtensionService* extensions_service = |
+ extensions::ExtensionSystem::Get(profile)->extension_service(); |
DCHECK(extensions_service); |
const DictionaryValue* dict; |
@@ -448,8 +456,8 @@ void BackgroundContentsService::LoadBackgroundContentsFromDictionary( |
void BackgroundContentsService::LoadBackgroundContentsFromManifests( |
Profile* profile) { |
- const ExtensionSet* extensions = |
- profile->GetExtensionService()->extensions(); |
+ const ExtensionSet* extensions = extensions::ExtensionSystem::Get(profile)-> |
+ extension_service()->extensions(); |
ExtensionSet::const_iterator iter = extensions->begin(); |
for (; iter != extensions->end(); ++iter) { |
const Extension* extension = *iter; |