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

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

Issue 10809008: Make spacing between uber tray items consistent with UI spec. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
« ash/system/tray/tray_item_view.h ('K') | « ash/system/user/tray_user.h ('k') | no next file » | 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 4e81ed4548946f91752b76a5192c18eaa8d7f982..ee7888868a099d8bba4ab7cbf49ebdf5b093f716 100644
--- a/ash/system/user/tray_user.cc
+++ b/ash/system/user/tray_user.cc
@@ -5,6 +5,7 @@
#include "ash/system/user/tray_user.h"
#include "ash/shell.h"
+#include "ash/system/tray/system_tray.h"
#include "ash/system/tray/system_tray_delegate.h"
#include "ash/system/tray/tray_constants.h"
#include "ash/system/tray/tray_item_view.h"
@@ -32,8 +33,6 @@
namespace {
const int kUserInfoVerticalPadding = 10;
-const int kUserInfoEmptyBorderLeftPadding = 6;
-const int kUserInfoEmptyBorderRightPadding = 1;
const int kUserIconSize = 27;
} // namespace
@@ -257,8 +256,8 @@ TrayUser::~TrayUser() {
views::View* TrayUser::CreateTrayView(user::LoginStatus status) {
CHECK(avatar_ == NULL);
avatar_ = new tray::RoundedImageView(kTrayRoundedBorderRadius);
- avatar_->set_border(views::Border::CreateEmptyBorder(
- 0, kUserInfoEmptyBorderLeftPadding, 0, kUserInfoEmptyBorderRightPadding));
+ UpdateAfterShelfAlignmentChange(
+ ash::Shell::GetInstance()->system_tray()->shelf_alignment());
UpdateAfterLoginStatusChange(status);
return avatar_;
}
@@ -299,6 +298,10 @@ void TrayUser::UpdateAfterLoginStatusChange(user::LoginStatus status) {
}
}
+void TrayUser::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {
+ SetTrayImageItemBorder(avatar_, alignment);
+}
+
void TrayUser::OnUserUpdate() {
avatar_->SetImage(
ash::Shell::GetInstance()->tray_delegate()->GetUserImage(),
« ash/system/tray/tray_item_view.h ('K') | « ash/system/user/tray_user.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698