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

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: Fix test. 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
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..e1d4506e5bf37489337d84f3f8677da70ae1d8e3 100644
--- a/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc
+++ b/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc
@@ -63,12 +63,10 @@ void ZoomBubbleView::ShowBubble(content::WebContents* web_contents,
ZoomController::FromWebContents(web_contents);
const extensions::Extension* extension = zoom_controller->last_extension();
- // If the bubble is already showing in this window and the zoom change was not
- // initiated by an extension, then the bubble can be reused and only the label
- // text needs to be updated.
if (zoom_bubble_ &&
zoom_bubble_->GetAnchorView() == anchor_view &&
!extension) {
+ DCHECK_EQ(web_contents, zoom_bubble_->web_contents_);
zoom_bubble_->Refresh();
return;
}
@@ -174,6 +172,9 @@ void ZoomBubbleView::Refresh() {
}
void ZoomBubbleView::Close() {
+ // Prevent inadvertent re-use of this bubble.
sky 2014/11/12 21:48:55 This isn't entirely clear. Maybe something like Cl
wjmaclean 2014/11/12 22:00:00 Done. I assume you meant "Widget's Close() is asy
+ zoom_bubble_ = NULL;
+ web_contents_ = NULL;
GetWidget()->Close();
}
@@ -350,13 +351,6 @@ void ZoomBubbleView::OnImmersiveModeControllerDestroyed() {
immersive_mode_controller_ = NULL;
}
-void ZoomBubbleView::WindowClosing() {
sky 2014/11/12 21:48:55 You should still keep this. The reason you want th
wjmaclean 2014/11/12 22:00:01 Sounds fair ... didn't realize that would happen.
- // |zoom_bubble_| can be a new bubble by this point (as Close(); doesn't
- // call this right away). Only set to NULL when it's this bubble.
- if (zoom_bubble_ == this)
- zoom_bubble_ = NULL;
-}
-
ZoomBubbleView::ZoomBubbleExtensionInfo::ZoomBubbleExtensionInfo() {}
ZoomBubbleView::ZoomBubbleExtensionInfo::~ZoomBubbleExtensionInfo() {}

Powered by Google App Engine
This is Rietveld 408576698