summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-30 23:01:44 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-30 23:01:44 +0000
commit5a9280908ae2e9a3abb5d0c1888dc96f828c1bf3 (patch)
tree718c4d0ab16cfcd2d1e310363b367e047c82813f
parentb0c08fdf98bb655b7a99a1f13ec26b355298744a (diff)
downloadchromium_src-5a9280908ae2e9a3abb5d0c1888dc96f828c1bf3.zip
chromium_src-5a9280908ae2e9a3abb5d0c1888dc96f828c1bf3.tar.gz
chromium_src-5a9280908ae2e9a3abb5d0c1888dc96f828c1bf3.tar.bz2
GTK find bar positioning: Don't try to make a negative-width rectangle.
BUG=none TEST=make your browser very narrow in debug mode, it doesn't crash Review URL: http://codereview.chromium.org/159665 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22117 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/gtk/find_bar_gtk.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/browser/gtk/find_bar_gtk.cc b/chrome/browser/gtk/find_bar_gtk.cc
index 5f17d0c..ab068c5 100644
--- a/chrome/browser/gtk/find_bar_gtk.cc
+++ b/chrome/browser/gtk/find_bar_gtk.cc
@@ -345,9 +345,11 @@ gfx::Rect FindBarGtk::GetDialogPosition(gfx::Rect avoid_overlapping_rect) {
bool ltr = l10n_util::GetTextDirection() == l10n_util::LEFT_TO_RIGHT;
// 15 is the size of the scrollbar, copied from ScrollbarThemeChromium.
// The height is not used.
+ // At very low browser widths we can wind up with a negative |dialog_bounds|
+ // width, so clamp it to 0.
gfx::Rect dialog_bounds = gfx::Rect(ltr ? 0 : 15, 0,
- widget()->allocation.width -
- (ltr ? 15 : 0),
+ std::max(0, widget()->allocation.width -
+ (ltr ? 15 : 0)),
0);
GtkRequisition req;