diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-11 00:27:14 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-11 00:27:14 +0000 |
commit | daba9ebc9d294a645e5569617628a73289755311 (patch) | |
tree | 8b7fb3ece5914eb11ad48226039271192c667d62 /chrome/browser/browser.cc | |
parent | ca7bf5806cf02793cbd756b7138cd766cc2caf28 (diff) | |
download | chromium_src-daba9ebc9d294a645e5569617628a73289755311.zip chromium_src-daba9ebc9d294a645e5569617628a73289755311.tar.gz chromium_src-daba9ebc9d294a645e5569617628a73289755311.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@22985 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 562f3b0..21caab1 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -23,6 +23,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/find_bar.h" #include "chrome/browser/find_bar_controller.h" #include "chrome/browser/location_bar.h" @@ -190,6 +191,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()); @@ -2101,6 +2104,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; |