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

Unified Diff: chrome/browser/ui/views/find_bar_host.cc

Issue 1478303003: Converted all Views to use an InkDropDelegate instead of a InkDropAnimationController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added missing include. Created 5 years 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/find_bar_host.cc
diff --git a/chrome/browser/ui/views/find_bar_host.cc b/chrome/browser/ui/views/find_bar_host.cc
index e8c9d2b16ee09017575ab622fe6ac3408da3aac5..08c4c9c88798ed9955577c5c8e334c6e536bbddb 100644
--- a/chrome/browser/ui/views/find_bar_host.cc
+++ b/chrome/browser/ui/views/find_bar_host.cc
@@ -300,15 +300,22 @@ gfx::Rect FindBarHost::GetDialogPosition(gfx::Rect avoid_overlapping_rect) {
gfx::Rect new_pos = FindBarController::GetLocationForFindbarView(
view_location, widget_bounds, avoid_overlapping_rect);
+ // While we are animating, the Find window will grow bottoms up so we need to
+ // re-position the widget so that it appears to grow out of the toolbar.
+ if (animation_offset() > 0)
+ new_pos.Offset(0, std::min(0, -animation_offset()));
+
return new_pos;
}
void FindBarHost::SetDialogPosition(const gfx::Rect& new_pos) {
- DropdownBarHost::SetDialogPosition(new_pos);
-
if (new_pos.IsEmpty())
return;
+ if (!host()->IsVisible())
+ host()->Show();
+ host()->SetBounds(new_pos);
+
// Tell the immersive mode controller about the find bar's new bounds. The
// immersive mode controller uses the bounds to keep the top-of-window views
// revealed when the mouse is hovered over the find bar.

Powered by Google App Engine
This is Rietveld 408576698