Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Unified Diff: ash/system/user/tray_user.cc

Issue 11410024: ui: Remove gfx::Size::ClampToNonNegative, prevent negative sizes always. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: negative-width Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/draw_quad_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/user/tray_user.cc
diff --git a/ash/system/user/tray_user.cc b/ash/system/user/tray_user.cc
index 308fe51a46c301c86d47b14a30f61ce0850f99c5..287e584e3000bdcc6c1d6aed1f0f0114e3b9560e 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);
« no previous file with comments | « no previous file | cc/draw_quad_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698