diff options
author | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-09 18:38:30 +0000 |
---|---|---|
committer | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-09 18:38:30 +0000 |
commit | 2609f86aa38f7d60f99a2c7b16681ff11c7098cb (patch) | |
tree | ff341370a624a036daf2426bfb296af6aee6f19c /chrome/browser/views/status_bubble_views.cc | |
parent | bbb436fa38e9a1aac3e4f638985835bb08b1733a (diff) | |
download | chromium_src-2609f86aa38f7d60f99a2c7b16681ff11c7098cb.zip chromium_src-2609f86aa38f7d60f99a2c7b16681ff11c7098cb.tar.gz chromium_src-2609f86aa38f7d60f99a2c7b16681ff11c7098cb.tar.bz2 |
Fix NOTREACHED in status bubble if window is made too small.
Review URL: http://codereview.chromium.org/100150
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15728 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/status_bubble_views.cc')
-rw-r--r-- | chrome/browser/views/status_bubble_views.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/browser/views/status_bubble_views.cc b/chrome/browser/views/status_bubble_views.cc index 6468c7a..e47b4ea 100644 --- a/chrome/browser/views/status_bubble_views.cc +++ b/chrome/browser/views/status_bubble_views.cc @@ -412,10 +412,11 @@ void StatusBubbleViews::StatusView::Paint(ChromeCanvas* canvas) { // to x() and y() for the highlight text, we still won't overlap the shadow. int text_width = std::min(views::Label::GetFont().GetStringWidth(text_), width - (kShadowThickness * 2) - kTextPositionX - kTextHorizPadding - 1); + int text_height = height - (kShadowThickness * 2) - 1; gfx::Rect body_bounds(kShadowThickness + kTextPositionX, kShadowThickness, - text_width, - height - (kShadowThickness * 2) - 1); + std::max(0, text_width), + std::max(0, text_height)); body_bounds.set_x(MirroredLeftPointForRect(body_bounds)); canvas->DrawStringInt(text_, views::Label::GetFont(), |