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

Unified Diff: chrome/browser/ui/views/location_bar/zoom_bubble_view.cc

Issue 712993004: Don't re-use a zoom bubble unless it has the same web-contents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore WindowClosing(), improve comments. Created 6 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/location_bar/zoom_bubble_view_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « no previous file | chrome/browser/ui/views/location_bar/zoom_bubble_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698