Chromium Code Reviews| 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_); |
| } |