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

Unified Diff: chrome/browser/background_contents_service.cc

Issue 7012031: Fix a couple of crashes related to app-crashed balloon. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/background_contents_service.cc
diff --git a/chrome/browser/background_contents_service.cc b/chrome/browser/background_contents_service.cc
index 1c22b5195572e004c465980f2c6ab9ea23c160f3..a07bf453022015d1c0dc73cce21f94cc848f022f 100644
--- a/chrome/browser/background_contents_service.cc
+++ b/chrome/browser/background_contents_service.cc
@@ -65,8 +65,25 @@ class CrashNotificationDelegate : public NotificationDelegate {
void Click() {
if (is_hosted_app_) {
- BackgroundContentsServiceFactory::GetForProfile(profile_)->
- LoadBackgroundContentsForExtension(profile_, extension_id_);
+ const Extension* extension =
+ profile_->GetExtensionService()->GetInstalledExtension(extension_id_);
+ if (extension && extension->background_url().is_valid()) {
+ // If the app has a background page listed in the manifest, then reload
+ // the background page.
+ BackgroundContentsServiceFactory::GetForProfile(profile_)->
+ LoadBackgroundContentsForExtension(profile_, extension_id_);
+ } else if (extension) {
+ // Try to open the home page for the crashed app. If there is already an
+ // open sad tab for it, try to reload the app in that tab. If a tab
+ // cannot be opened because there is no appropriate window, then open a
+ // new window for the app.
+ if (!Browser::OpenApplicationTab(profile_, extension, SINGLETON_TAB)) {
Andrew T Wilson (Slow) 2011/05/14 01:01:37 I'm not positive this is the right behavior: 1) W
+ Browser::OpenApplicationWindow(profile_, extension,
+ extension_misc::LAUNCH_WINDOW,
+ extension->GetFullLaunchURL(),
+ NULL);
+ }
+ }
} else {
profile_->GetExtensionService()->ReloadExtension(extension_id_);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698