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

Unified Diff: chrome/browser/ui/views/infobars/infobar_view.cc

Issue 7796010: Attempt at fixing crash in menus shown from infobars. Here's what the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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
Index: chrome/browser/ui/views/infobars/infobar_view.cc
diff --git a/chrome/browser/ui/views/infobars/infobar_view.cc b/chrome/browser/ui/views/infobars/infobar_view.cc
index 8faa905a9dfc4a60100ab33d6db12678f2ab148e..2da2235aadcd039838704ae9504b22ddc31596a2 100644
--- a/chrome/browser/ui/views/infobars/infobar_view.cc
+++ b/chrome/browser/ui/views/infobars/infobar_view.cc
@@ -210,7 +210,10 @@ void InfoBarView::Layout() {
void InfoBarView::ViewHierarchyChanged(bool is_add, View* parent, View* child) {
View::ViewHierarchyChanged(is_add, parent, child);
- if (is_add && (child == this) && (close_button_ == NULL)) {
+ if (!is_add && (child == this)) {
+ // We're being removed. Cancel any menus we may have open.
Peter Kasting 2011/09/12 18:06:00 Do this at the top of PlatformSpecificHide() inste
+ CancelMenu();
+ } else if (is_add && (child == this) && (close_button_ == NULL)) {
gfx::Image* image = delegate()->GetIcon();
if (image) {
icon_ = new views::ImageView;

Powered by Google App Engine
This is Rietveld 408576698