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

Unified Diff: chrome/browser/gtk/infobar_container_gtk.cc

Issue 4767001: Make TabContents own its infobar delegates.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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
Index: chrome/browser/gtk/infobar_container_gtk.cc
===================================================================
--- chrome/browser/gtk/infobar_container_gtk.cc (revision 65711)
+++ chrome/browser/gtk/infobar_container_gtk.cc (working copy)
@@ -123,12 +123,12 @@
} else if (type == NotificationType::TAB_CONTENTS_INFOBAR_REMOVED) {
RemoveInfoBar(Details<InfoBarDelegate>(details).ptr(), true);
} else if (type == NotificationType::TAB_CONTENTS_INFOBAR_REPLACED) {
- std::pair<InfoBarDelegate*, InfoBarDelegate*>* delegates =
- Details<std::pair<InfoBarDelegate*, InfoBarDelegate*> >(details).ptr();
+ typedef std::pair<InfoBarDelegate*, InfoBarDelegate*> DelegatePair;
+ DelegatePair* delegate_pair = Details<DelegatePair>(details).ptr();
// By not animating the removal/addition, this appears to be a replace.
- RemoveInfoBar(delegates->first, false);
- AddInfoBar(delegates->second, false);
+ RemoveInfoBar(delegate_pair->first, false);
+ AddInfoBar(delegate_pair->second, false);
} else {
NOTREACHED();
}
@@ -156,7 +156,7 @@
this_bar = reinterpret_cast<InfoBar*>(
g_object_get_data(G_OBJECT(iter->data), kInfoBar));
- if (this_bar->delegate() == delegate)
+ if ((delegate != NULL) && (this_bar->delegate() == delegate))
break;
if (!this_bar->IsClosing())

Powered by Google App Engine
This is Rietveld 408576698