diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-18 15:40:32 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-18 15:40:32 +0000 |
commit | e4b553615a137a007b7c073d2ac2189fad00b6eb (patch) | |
tree | 6e9b0ebb9c096e5b089121d622a81af60491223a /chrome/browser/browser.cc | |
parent | f29bbb655c535a6977cb13093ad42f51ca23b461 (diff) | |
download | chromium_src-e4b553615a137a007b7c073d2ac2189fad00b6eb.zip chromium_src-e4b553615a137a007b7c073d2ac2189fad00b6eb.tar.gz chromium_src-e4b553615a137a007b7c073d2ac2189fad00b6eb.tar.bz2 |
Fix "crashed extension" infobar browser crashes.
This is a general rework of how "crashed extension" infobar works
and how the extension is actually recovered after the crash.
TEST=See bug.
http://crbug.com/15888
Review URL: http://codereview.chromium.org/164151
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23628 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r-- | chrome/browser/browser.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index d72c24a..d7808ad 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -24,6 +24,7 @@ #include "chrome/browser/download/download_manager.h" #include "chrome/browser/download/download_shelf.h" #include "chrome/browser/download/download_started_animation.h" +#include "chrome/browser/extensions/crashed_extension_infobar.h" #include "chrome/browser/extensions/extension_disabled_infobar_delegate.h" #include "chrome/browser/find_bar.h" #include "chrome/browser/find_bar_controller.h" @@ -195,6 +196,8 @@ Browser::Browser(Type type, Profile* profile) NotificationService::AllSources()); registrar_.Add(this, NotificationType::EXTENSION_UNLOADED, NotificationService::AllSources()); + registrar_.Add(this, NotificationType::EXTENSION_PROCESS_CRASHED, + NotificationService::AllSources()); registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, NotificationService::AllSources()); @@ -2081,6 +2084,18 @@ void Browser::Observe(NotificationType type, break; } + case NotificationType::EXTENSION_PROCESS_CRASHED: { + TabContents* tab_contents = GetSelectedTabContents(); + if (!tab_contents) + break; + ExtensionsService* extensions_service = + Source<ExtensionsService>(source).ptr(); + ExtensionHost* extension_host = Details<ExtensionHost>(details).ptr(); + tab_contents->AddInfoBar(new CrashedExtensionInfoBarDelegate( + tab_contents, extensions_service, extension_host->extension())); + break; + } + case NotificationType::BROWSER_THEME_CHANGED: window()->UserChangedTheme(); break; |