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

Unified Diff: chrome/browser/background/background_contents_service.cc

Issue 9150008: Introduce background.scripts feature for extension manifests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ready to land Created 8 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
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 5072851f8f0e62a4797f72cb795c7980f1a9436d..cee5dabbdcbe45b433a216c575d74f99636cd91b 100644
--- a/chrome/browser/background/background_contents_service.cc
+++ b/chrome/browser/background/background_contents_service.cc
@@ -239,7 +239,7 @@ void BackgroundContentsService::Observe(
if (extension_service) {
const Extension* extension =
extension_service->GetExtensionById(UTF16ToUTF8(appid), false);
- if (extension && extension->background_url().is_valid())
+ if (extension && extension->has_background_page())
break;
}
RegisterBackgroundContents(bgcontents);
@@ -250,7 +250,7 @@ void BackgroundContentsService::Observe(
content::Details<const Extension>(details).ptr();
Profile* profile = content::Source<Profile>(source).ptr();
if (extension->is_hosted_app() &&
- extension->background_url().is_valid()) {
+ extension->has_background_page()) {
// If there is a background page specified in the manifest for a hosted
// app, then blow away registered urls in the pref.
ShutdownAssociatedBackgroundContents(ASCIIToUTF16(extension->id()));
@@ -260,7 +260,7 @@ void BackgroundContentsService::Observe(
// Now load the manifest-specified background page. If service isn't
// ready, then the background page will be loaded from the
// EXTENSIONS_READY callback.
- LoadBackgroundContents(profile, extension->background_url(),
+ LoadBackgroundContents(profile, extension->GetBackgroundURL(),
ASCIIToUTF16("background"), UTF8ToUTF16(extension->id()));
}
}
@@ -314,7 +314,7 @@ void BackgroundContentsService::Observe(
// BackgroundContents in place.
const Extension* extension =
content::Details<UnloadedExtensionInfo>(details)->extension;
- if (extension->background_url().is_valid())
+ if (extension->has_background_page())
ShutdownAssociatedBackgroundContents(ASCIIToUTF16(extension->id()));
break;
}
@@ -378,9 +378,9 @@ void BackgroundContentsService::LoadBackgroundContentsForExtension(
const Extension* extension =
profile->GetExtensionService()->GetExtensionById(extension_id, false);
DCHECK(!extension || extension->is_hosted_app());
- if (extension && extension->background_url().is_valid()) {
+ if (extension && extension->has_background_page()) {
LoadBackgroundContents(profile,
- extension->background_url(),
+ extension->GetBackgroundURL(),
ASCIIToUTF16("background"),
UTF8ToUTF16(extension->id()));
return;
@@ -425,10 +425,9 @@ void BackgroundContentsService::LoadBackgroundContentsFromManifests(
ExtensionSet::const_iterator iter = extensions->begin();
for (; iter != extensions->end(); ++iter) {
const Extension* extension = *iter;
- if (extension->is_hosted_app() &&
- extension->background_url().is_valid()) {
+ if (extension->is_hosted_app() && extension->has_background_page()) {
LoadBackgroundContents(profile,
- extension->background_url(),
+ extension->GetBackgroundURL(),
ASCIIToUTF16("background"),
UTF8ToUTF16(extension->id()));
}
« no previous file with comments | « chrome/browser/automation/testing_automation_provider.cc ('k') | chrome/browser/extensions/background_scripts_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698