diff options
author | kuan@chromium.org <kuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-20 03:26:00 +0000 |
---|---|---|
committer | kuan@chromium.org <kuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-20 03:26:00 +0000 |
commit | 109f7236ba8d73e42841760cefe5a3e1539bbc1e (patch) | |
tree | 12d8f8c590e33ccbf0f255ae55f9f203dce5dea9 | |
parent | 840b0db73b1a8b16291d9d8444c59ee06d2da06e (diff) | |
download | chromium_src-109f7236ba8d73e42841760cefe5a3e1539bbc1e.zip chromium_src-109f7236ba8d73e42841760cefe5a3e1539bbc1e.tar.gz chromium_src-109f7236ba8d73e42841760cefe5a3e1539bbc1e.tar.bz2 |
Fix assert in sad_tab when requested width for message is < -1.
BUG=28270
TEST=verify per bug report.
Review URL: http://codereview.chromium.org/414022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32595 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/gtk/sad_tab_gtk.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/browser/gtk/sad_tab_gtk.cc b/chrome/browser/gtk/sad_tab_gtk.cc index b805c1d..b579861 100644 --- a/chrome/browser/gtk/sad_tab_gtk.cc +++ b/chrome/browser/gtk/sad_tab_gtk.cc @@ -168,8 +168,10 @@ void SadTabGtk::OnSizeAllocate(GtkWidget* widget, GtkAllocation* allocation) { // Only readjust width for message if width of widget has changed. if (allocation->width != 0 && allocation->width != width_) { width_ = allocation->width; - // Set width for wrappable message. - gtk_widget_set_size_request(message_, width_ - (kTabHorzMargin * 2), -1); + // If necessary, set width for wrappable message. + int message_width = width_ - (kTabHorzMargin * 2); + if (message_width > -1) + gtk_widget_set_size_request(message_, message_width, -1); } } |