summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-08 16:02:05 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-08 16:02:05 +0000
commit190d06bf03d4c310f042396046b2b5b5f7af43cf (patch)
treed2b11881ccfe6f6c78557b83f14fe9c64d7d1b21 /ash
parent41b9266435fba2235d705ee0df8ca960b3c72f03 (diff)
downloadchromium_src-190d06bf03d4c310f042396046b2b5b5f7af43cf.zip
chromium_src-190d06bf03d4c310f042396046b2b5b5f7af43cf.tar.gz
chromium_src-190d06bf03d4c310f042396046b2b5b5f7af43cf.tar.bz2
ui: Remove gfx::Size::ClampToNonNegative, prevent negative sizes always.
This was added with the intention of using Size as a vector, replacing use of IntSize. Since we have Vector2d now, negative sizes should not exist, so clamp them in set_width/set_height and the constructor. Not covered by tests, as we can't test DCHECKs. TBR=sky BUG=160158 Relanding: https://codereview.chromium.org/11365160/ Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=167255 Review URL: https://chromiumcodereview.appspot.com/11410024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175535 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-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 308fe51..287e584 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);