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

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

Issue 12253022: Manifest handler for all keys background-related. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 883160b869aa290c38a324373274693170ef2261..8cd75d7357717ab14681a19f6ecb1357125ac594 100644
--- a/chrome/browser/background/background_contents_service.cc
+++ b/chrome/browser/background/background_contents_service.cc
@@ -29,6 +29,7 @@
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/api/icons/icons_handler.h"
+#include "chrome/common/extensions/background_info.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_icon_set.h"
@@ -42,6 +43,7 @@
using content::SiteInstance;
using content::WebContents;
+using extensions::BackgroundInfo;
using extensions::Extension;
using extensions::UnloadedExtensionInfo;
@@ -267,7 +269,7 @@ void BackgroundContentsService::Observe(
if (extension_service) {
const Extension* extension =
extension_service->GetExtensionById(UTF16ToUTF8(appid), false);
- if (extension && extension->has_background_page())
+ if (extension && BackgroundInfo::HasBackgroundPage(extension))
break;
}
RegisterBackgroundContents(bgcontents);
@@ -278,7 +280,7 @@ void BackgroundContentsService::Observe(
content::Details<const Extension>(details).ptr();
Profile* profile = content::Source<Profile>(source).ptr();
if (extension->is_hosted_app() &&
- extension->has_background_page()) {
+ BackgroundInfo::HasBackgroundPage(extension)) {
// 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()));
@@ -289,8 +291,10 @@ 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->GetBackgroundURL(),
- ASCIIToUTF16("background"), UTF8ToUTF16(extension->id()));
+ LoadBackgroundContents(profile,
+ BackgroundInfo::GetBackgroundURL(extension),
+ ASCIIToUTF16("background"),
+ UTF8ToUTF16(extension->id()));
}
}
@@ -349,7 +353,7 @@ void BackgroundContentsService::Observe(
// from the LOADED callback.
const Extension* extension =
content::Details<UnloadedExtensionInfo>(details)->extension;
- if (extension->has_background_page())
+ if (BackgroundInfo::HasBackgroundPage(extension))
ShutdownAssociatedBackgroundContents(ASCIIToUTF16(extension->id()));
break;
}
@@ -422,9 +426,9 @@ void BackgroundContentsService::LoadBackgroundContentsForExtension(
extensions::ExtensionSystem::Get(profile)->extension_service()->
GetExtensionById(extension_id, false);
DCHECK(!extension || extension->is_hosted_app());
- if (extension && extension->has_background_page()) {
+ if (extension && BackgroundInfo::HasBackgroundPage(extension)) {
LoadBackgroundContents(profile,
- extension->GetBackgroundURL(),
+ BackgroundInfo::GetBackgroundURL(extension),
ASCIIToUTF16("background"),
UTF8ToUTF16(extension->id()));
return;
@@ -470,9 +474,10 @@ void BackgroundContentsService::LoadBackgroundContentsFromManifests(
ExtensionSet::const_iterator iter = extensions->begin();
for (; iter != extensions->end(); ++iter) {
const Extension* extension = *iter;
- if (extension->is_hosted_app() && extension->has_background_page()) {
+ if (extension->is_hosted_app() &&
+ BackgroundInfo::HasBackgroundPage(extension)) {
LoadBackgroundContents(profile,
- extension->GetBackgroundURL(),
+ BackgroundInfo::GetBackgroundURL(extension),
ASCIIToUTF16("background"),
UTF8ToUTF16(extension->id()));
}
« no previous file with comments | « chrome/browser/background/background_application_list_model.cc ('k') | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698