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

Unified Diff: chrome/browser/ui/gtk/infobars/extension_infobar_gtk.cc

Issue 12208091: ExtensionInfobarGtk doesn't handle delegate going away. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 10 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/browser/ui/gtk/infobars/extension_infobar_gtk.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/infobars/extension_infobar_gtk.cc
diff --git a/chrome/browser/ui/gtk/infobars/extension_infobar_gtk.cc b/chrome/browser/ui/gtk/infobars/extension_infobar_gtk.cc
index c69b5ded277b53494ba18b852e23002b5adf1689..b8336e0ccabf3d4553ea9f2608cf9b503c234f80 100644
--- a/chrome/browser/ui/gtk/infobars/extension_infobar_gtk.cc
+++ b/chrome/browser/ui/gtk/infobars/extension_infobar_gtk.cc
@@ -33,6 +33,8 @@ ExtensionInfoBarGtk::ExtensionInfoBarGtk(InfoBarService* owner,
delegate_(delegate),
view_(NULL),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {
+ delegate->set_observer(this);
+
// Always render the close button as if we were doing chrome style widget
// rendering. For extension infobars, we force chrome style rendering because
// extension authors are going to expect to match the declared gradient in
@@ -46,7 +48,10 @@ ExtensionInfoBarGtk::ExtensionInfoBarGtk(InfoBarService* owner,
BuildWidgets();
}
-ExtensionInfoBarGtk::~ExtensionInfoBarGtk() {}
+ExtensionInfoBarGtk::~ExtensionInfoBarGtk() {
+ if (delegate_)
+ delegate_->set_observer(NULL);
+}
void ExtensionInfoBarGtk::PlatformSpecificHide(bool animate) {
// This view is not owned by us; we can't unparent it because we aren't the
@@ -148,6 +153,10 @@ void ExtensionInfoBarGtk::StoppedShowing() {
gtk_chrome_button_unset_paint_state(GTK_CHROME_BUTTON(button_));
}
+void ExtensionInfoBarGtk::OnDelegateDeleted() {
+ delegate_ = NULL;
+}
+
Browser* ExtensionInfoBarGtk::GetBrowser() {
// Get the Browser object this infobar is attached to.
GtkWindow* parent = platform_util::GetTopLevel(icon_);
« no previous file with comments | « chrome/browser/ui/gtk/infobars/extension_infobar_gtk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698