summaryrefslogtreecommitdiffstats
path: root/ash/system
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-23 02:45:00 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-23 02:45:00 +0000
commit0cb0761db9b7a54a2102b8e0f7975ed221d04e80 (patch)
tree875a07ac2dcdfbfe4cb911aa9e35dde3dd483fb6 /ash/system
parent49769d31820e00ee35c4a554e9e557023d8948ce (diff)
downloadchromium_src-0cb0761db9b7a54a2102b8e0f7975ed221d04e80.zip
chromium_src-0cb0761db9b7a54a2102b8e0f7975ed221d04e80.tar.gz
chromium_src-0cb0761db9b7a54a2102b8e0f7975ed221d04e80.tar.bz2
ash: Prevent negative sizes.
Use std::max(0, ) to bound sizes at 0. TBR=sky BUG=160158 Relanding https://codereview.chromium.org/11365160/ in pieces. Review URL: https://chromiumcodereview.appspot.com/12052016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178219 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system')
-rw-r--r--ash/system/user/tray_user.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/ash/system/user/tray_user.cc b/ash/system/user/tray_user.cc
index f433887..de5f7cb 100644
--- a/ash/system/user/tray_user.cc
+++ b/ash/system/user/tray_user.cc
@@ -432,8 +432,9 @@ void UserView::Layout() {
// Give the remaining space to the user card.
gfx::Rect user_card_area = contents_area;
- user_card_area.set_width(contents_area.width() -
- (logout_area.width() + kTrayPopupPaddingBetweenItems));
+ int remaining_width = contents_area.width() -
+ (logout_area.width() + kTrayPopupPaddingBetweenItems);
+ user_card_area.set_width(std::max(0, remaining_width));
user_card_->SetBoundsRect(user_card_area);
} else if (user_card_) {
user_card_->SetBoundsRect(contents_area);