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

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

Issue 413433002: Refactor BubbleDelegateView::use_focuseless() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't reopen the bubble without good reason Created 6 years, 5 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/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 3ab1d2f773bc0faf95a00ffe0d1dd5f24b472a52..fad9abf6445a2d2626ef0c37639e30a625c59cc9 100644
--- a/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc
+++ b/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc
@@ -63,21 +63,18 @@ 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, its |auto_close_| value
- // is equal to |auto_close|, 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 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 &&
- zoom_bubble_->auto_close_ == auto_close &&
!extension) {
zoom_bubble_->Refresh();
return;
}
- // If the bubble is already showing but its |auto_close_| value is not equal
- // to |auto_close|, the bubble's focus properties must change, so the
- // current bubble must be closed and a new one created.
+ // If the bubble is already showing but in the different tab, the current
msw 2014/07/25 15:38:38 nit: "in a different"
vasilii 2014/07/25 15:48:20 Done.
+ // bubble must be closed and a new one created.
CloseBubble();
zoom_bubble_ = new ZoomBubbleView(anchor_view,
@@ -101,7 +98,7 @@ void ZoomBubbleView::ShowBubble(content::WebContents* web_contents,
if (is_fullscreen)
zoom_bubble_->AdjustForFullscreen(browser_view->GetBoundsInScreen());
- if (zoom_bubble_->use_focusless())
+ if (auto_close)
zoom_bubble_->GetWidget()->ShowInactive();
else
zoom_bubble_->GetWidget()->Show();
@@ -139,7 +136,6 @@ ZoomBubbleView::ZoomBubbleView(
immersive_mode_controller_(immersive_mode_controller) {
// Compensate for built-in vertical padding in the anchor view's image.
set_anchor_view_insets(gfx::Insets(5, 0, 5, 0));
- set_use_focusless(auto_close);
set_notify_enter_exit_on_child(true);
// Add observers to close the bubble if the fullscreen state or immersive
@@ -250,12 +246,10 @@ void ZoomBubbleView::OnExtensionIconImageChanged(
}
void ZoomBubbleView::OnMouseEntered(const ui::MouseEvent& event) {
- set_use_focusless(false);
StopTimer();
}
void ZoomBubbleView::OnMouseExited(const ui::MouseEvent& event) {
- set_use_focusless(auto_close_);
StartTimerIfNecessary();
}
@@ -265,9 +259,8 @@ void ZoomBubbleView::OnGestureEvent(ui::GestureEvent* event) {
return;
}
- // If an auto-closing bubble was tapped, show a non-auto-closing bubble in
- // its place.
- ShowBubble(zoom_bubble_->web_contents_, false);
+ auto_close_ = false;
+ StopTimer();
event->SetHandled();
}
« no previous file with comments | « chrome/browser/ui/views/autofill/tooltip_icon.cc ('k') | chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698