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

Unified Diff: chrome/browser/browser.cc

Issue 164151: Fix "crashed extension" infobar browser crashes.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: sync with trunk Created 11 years, 4 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 | « chrome/app/generated_resources.grd ('k') | chrome/browser/extensions/crashed_extension_infobar.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser.cc
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index d9d299660c7a985705cc240184889658a73c676d..fb539aa9052a71ba849d1daf0484bf8a4f964150 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());
@@ -2095,6 +2098,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;
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/extensions/crashed_extension_infobar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698