Index: chrome/browser/ui/views/location_bar/zoom_bubble_view.cc |
diff --git a/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc b/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc |
index 081b8b2e8256a50a55c2c71cda00e17a0e5a41c7..fd6b6ae60c3610ce61b5e46b7f56b0e313f30f52 100644 |
--- a/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc |
+++ b/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc |
@@ -69,6 +69,7 @@ void ZoomBubbleView::ShowBubble(content::WebContents* web_contents, |
if (zoom_bubble_ && |
zoom_bubble_->GetAnchorView() == anchor_view && |
!extension) { |
+ DCHECK_EQ(web_contents, zoom_bubble_->web_contents_); |
zoom_bubble_->Refresh(); |
return; |
} |
@@ -174,6 +175,10 @@ void ZoomBubbleView::Refresh() { |
} |
void ZoomBubbleView::Close() { |
+ // Widget's Close() is async, but we don't want to use zoom_bubble_ after |
+ // this. Additionally web_contents_ may have been destroyed. |
+ zoom_bubble_ = NULL; |
+ web_contents_ = NULL; |
GetWidget()->Close(); |
} |