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

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

Issue 11110004: Make gfx::Rect class operations consistently mutate the class they are called on. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: cc/ fixes Created 8 years, 2 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 | « ash/system/tray/tray_views.cc ('k') | ash/tooltips/tooltip_controller.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 7b90d873f65e2449012da597d56b77828660017d..262ae6fd719223c0f61880436d1be1db852f08f1 100644
--- a/ash/system/user/tray_user.cc
+++ b/ash/system/user/tray_user.cc
@@ -76,7 +76,8 @@ class RoundedImageView : public views::View {
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
View::OnPaint(canvas);
gfx::Rect image_bounds(GetPreferredSize());
- image_bounds = gfx::Rect(size()).Center(image_bounds.size());
+ image_bounds = gfx::Rect(size());
+ image_bounds.ClampToCenteredSize(image_bounds.size());
image_bounds.Inset(GetInsets());
const SkScalar kRadius = SkIntToScalar(corner_radius_);
SkPath path;
@@ -220,7 +221,8 @@ class UserView : public views::View,
container_->SetBoundsRect(gfx::Rect(size()));
if (signout_ && user_info_) {
gfx::Rect signout_bounds(signout_->GetPreferredSize());
- signout_bounds = bounds().Center(signout_bounds.size());
+ signout_bounds = bounds();
+ signout_bounds.ClampToCenteredSize(signout_bounds.size());
signout_bounds.set_x(width() - signout_bounds.width() -
kTrayPopupPaddingHorizontal);
signout_->SetBoundsRect(signout_bounds);
« no previous file with comments | « ash/system/tray/tray_views.cc ('k') | ash/tooltips/tooltip_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698