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

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

Issue 229453005: Shelf Cleanup AlternateShelfLayout P1 Attempt 3 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 8 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_constants.cc ('k') | ash/system/web_notification/web_notification_tray.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 e22cdf49d0cd4f6f4a13eed59df88b80a96257ea..2a8dfe139345acc6af7b57c11d1efdee97953003 100644
--- a/ash/system/user/tray_user.cc
+++ b/ash/system/user/tray_user.cc
@@ -33,9 +33,6 @@ namespace {
const int kUserLabelToIconPadding = 5;
-const int kTrayAvatarLargeSize = 32;
-const int kTrayAvatarLargeCornerRadius = 2;
-
} // namespace
namespace ash {
@@ -180,9 +177,9 @@ void TrayUser::UpdateAfterLoginStatusChange(user::LoginStatus status) {
label_->SetText(l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_GUEST_LABEL));
}
- if (avatar_ && switches::UseAlternateShelfLayout()) {
+ if (avatar_) {
avatar_->SetCornerRadii(
- 0, kTrayAvatarLargeCornerRadius, kTrayAvatarLargeCornerRadius, 0);
+ 0, kTrayAvatarCornerRadius, kTrayAvatarCornerRadius, 0);
avatar_->SetBorder(views::Border::NullBorder());
}
UpdateAvatarImage(status);
@@ -198,17 +195,9 @@ void TrayUser::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {
if (alignment == SHELF_ALIGNMENT_BOTTOM ||
alignment == SHELF_ALIGNMENT_TOP) {
if (avatar_) {
- if (switches::UseAlternateShelfLayout()) {
- avatar_->SetBorder(views::Border::NullBorder());
- avatar_->SetCornerRadii(
- 0, kTrayAvatarLargeCornerRadius, kTrayAvatarLargeCornerRadius, 0);
- } else {
- avatar_->SetBorder(views::Border::CreateEmptyBorder(
- 0,
- kTrayImageItemHorizontalPaddingBottomAlignment + 2,
- 0,
- kTrayImageItemHorizontalPaddingBottomAlignment));
- }
+ avatar_->SetBorder(views::Border::NullBorder());
+ avatar_->SetCornerRadii(
+ 0, kTrayAvatarCornerRadius, kTrayAvatarCornerRadius, 0);
}
if (label_) {
// If label_ hasn't figured out its size yet, do that first.
@@ -228,13 +217,9 @@ void TrayUser::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {
0, 0, kUserLabelToIconPadding));
} else {
if (avatar_) {
- if (switches::UseAlternateShelfLayout()) {
- avatar_->SetBorder(views::Border::NullBorder());
- avatar_->SetCornerRadii(
- 0, 0, kTrayAvatarLargeCornerRadius, kTrayAvatarLargeCornerRadius);
- } else {
- SetTrayImageItemBorder(avatar_, alignment);
- }
+ avatar_->SetBorder(views::Border::NullBorder());
+ avatar_->SetCornerRadii(
+ 0, 0, kTrayAvatarCornerRadius, kTrayAvatarCornerRadius);
}
if (label_) {
label_->SetBorder(views::Border::CreateEmptyBorder(
@@ -276,17 +261,14 @@ void TrayUser::UpdateAvatarImage(user::LoginStatus status) {
GetTrayIndex() >= session_state_delegate->NumberOfLoggedInUsers())
return;
- int icon_size = switches::UseAlternateShelfLayout() ? kTrayAvatarLargeSize
- : kTrayAvatarSize;
-
content::BrowserContext* context = session_state_delegate->
GetBrowserContextByIndex(GetTrayIndex());
avatar_->SetImage(session_state_delegate->GetUserImage(context),
- gfx::Size(icon_size, icon_size));
+ gfx::Size(kTrayAvatarSize, kTrayAvatarSize));
// Unit tests might come here with no images for some users.
if (avatar_->size().IsEmpty())
- avatar_->SetSize(gfx::Size(icon_size, icon_size));
+ avatar_->SetSize(gfx::Size(kTrayAvatarSize, kTrayAvatarSize));
}
MultiProfileIndex TrayUser::GetTrayIndex() {
« no previous file with comments | « ash/system/tray/tray_constants.cc ('k') | ash/system/web_notification/web_notification_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698