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

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

Issue 7285005: Make Windows FindBar stay within window bounds for narrow windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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
« no previous file with comments | « chrome/browser/ui/views/dropdown_bar_host_win.cc ('k') | chrome/browser/ui/views/find_bar_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/find_bar_host.cc
===================================================================
--- chrome/browser/ui/views/find_bar_host.cc (revision 90713)
+++ chrome/browser/ui/views/find_bar_host.cc (working copy)
@@ -125,6 +125,7 @@
SetDialogPosition(new_pos, no_redraw);
// May need to redraw our frame to accommodate bookmark bar styles.
+ view()->Layout(); // Bounds may have changed.
view()->SchedulePaint();
}
@@ -230,8 +231,7 @@
}
int FindBarHost::GetWidth() {
- NOTIMPLEMENTED();
- return 0;
+ return view()->width();
}
////////////////////////////////////////////////////////////////////////////////
@@ -247,6 +247,10 @@
// Ask the view how large an area it needs to draw on.
gfx::Size prefsize = view()->GetPreferredSize();
+ // Limit width to the available area.
+ if (widget_bounds.width() < prefsize.width())
+ prefsize.set_width(widget_bounds.width());
+
// Place the view in the top right corner of the widget boundaries (top left
// for RTL languages).
gfx::Rect view_location;
« no previous file with comments | « chrome/browser/ui/views/dropdown_bar_host_win.cc ('k') | chrome/browser/ui/views/find_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698