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

Unified Diff: ash/system/tray/tray_utils.cc

Issue 1877543002: Revise the shelf alignment locking mechanism. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update and cleanup tests. Created 4 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_item_view.cc ('k') | ash/system/user/tray_user.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/tray_utils.cc
diff --git a/ash/system/tray/tray_utils.cc b/ash/system/tray/tray_utils.cc
index fd2c81c9febea752a6a9d0bc32f0f92c19f589a3..9d58afb8f099de8e5d5431bd5c2dd5dff6014d47 100644
--- a/ash/system/tray/tray_utils.cc
+++ b/ash/system/tray/tray_utils.cc
@@ -4,6 +4,7 @@
#include "ash/system/tray/tray_utils.h"
+#include "ash/shelf/shelf_util.h"
#include "ash/system/tray/tray_constants.h"
#include "ash/system/tray/tray_item_view.h"
#include "ui/accessibility/ax_view_state.h"
@@ -26,11 +27,9 @@ void SetupLabelForTray(views::Label* label) {
void SetTrayImageItemBorder(views::View* tray_view,
ShelfAlignment alignment) {
- if (alignment == SHELF_ALIGNMENT_BOTTOM) {
+ if (IsHorizontalAlignment(alignment)) {
tray_view->SetBorder(views::Border::CreateEmptyBorder(
- 0,
- kTrayImageItemHorizontalPaddingBottomAlignment,
- 0,
+ 0, kTrayImageItemHorizontalPaddingBottomAlignment, 0,
kTrayImageItemHorizontalPaddingBottomAlignment));
} else {
tray_view->SetBorder(views::Border::CreateEmptyBorder(
@@ -43,11 +42,9 @@ void SetTrayImageItemBorder(views::View* tray_view,
void SetTrayLabelItemBorder(TrayItemView* tray_view,
ShelfAlignment alignment) {
- if (alignment == SHELF_ALIGNMENT_BOTTOM) {
+ if (IsHorizontalAlignment(alignment)) {
tray_view->SetBorder(views::Border::CreateEmptyBorder(
- 0,
- kTrayLabelItemHorizontalPaddingBottomAlignment,
- 0,
+ 0, kTrayLabelItemHorizontalPaddingBottomAlignment, 0,
kTrayLabelItemHorizontalPaddingBottomAlignment));
} else {
// Center the label for vertical launcher alignment.
@@ -55,10 +52,8 @@ void SetTrayLabelItemBorder(TrayItemView* tray_view,
(tray_view->GetPreferredSize().width() -
tray_view->label()->GetPreferredSize().width()) / 2);
tray_view->SetBorder(views::Border::CreateEmptyBorder(
- kTrayLabelItemVerticalPaddingVerticalAlignment,
- horizontal_padding,
- kTrayLabelItemVerticalPaddingVerticalAlignment,
- horizontal_padding));
+ kTrayLabelItemVerticalPaddingVerticalAlignment, horizontal_padding,
+ kTrayLabelItemVerticalPaddingVerticalAlignment, horizontal_padding));
}
}
« no previous file with comments | « ash/system/tray/tray_item_view.cc ('k') | ash/system/user/tray_user.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698