Chromium Code Reviews| Index: ash/system/tray/tray_constants.cc |
| diff --git a/ash/system/tray/tray_constants.cc b/ash/system/tray/tray_constants.cc |
| index 8557e2e38f2a5888371a9fe38d0c03701522922f..7e5ca9841f1d01510a0fe2e4cfff950f63f855ee 100644 |
| --- a/ash/system/tray/tray_constants.cc |
| +++ b/ash/system/tray/tray_constants.cc |
| @@ -5,6 +5,8 @@ |
| #include "ash/system/tray/tray_constants.h" |
| #include "ash/ash_switches.h" |
| +#include "ash/material_design/material_design_controller.h" |
| +#include "base/logging.h" |
| #include "third_party/skia/include/core/SkColor.h" |
| namespace ash { |
| @@ -21,7 +23,9 @@ const int kBubblePaddingHorizontalSide = 10; |
| const int kBubblePaddingVerticalBottom = 3; |
| const int kBubblePaddingVerticalSide = 15; |
| -const int kPaddingFromEdgeOfShelf = 3; |
| +// Padding used on empty border to Adjust the size of status tray dark |
|
tdanderson
2016/05/26 22:55:56
nit: Adjust -> adjust
yiyix
2016/06/02 03:54:54
Done.
|
| +// background. |
|
tdanderson
2016/05/26 22:55:56
Also, I am not a fan of how the comment is worded.
yiyix
2016/06/02 03:54:53
Done. I update the name as we have discussed in pe
|
| +const int kEmptyBoarderPadding = 3; |
| // Top inset of system tray bubble for bottom anchor alignment. |
| const int kTrayBubbleAnchorTopInsetBottomAnchor = 3; |
| @@ -81,7 +85,29 @@ const int kTrayNotificationContentsWidth = kTrayPopupMinWidth - |
| const int kTrayAvatarCornerRadius = 2; |
| const int kTrayAvatarSize = 32; |
| -const int kTraySpacing = 4; |
| +const int kMessageCenterBubblePadding = 4; |
| const int kShelfItemHeight = 38; |
| +// static |
| +int GetShelfStatusAreaInset(ShelfStatusAreaInset constant) { |
|
tdanderson
2016/05/26 22:55:56
I would just call this GetTrayConstant(). Similarl
yiyix
2016/06/02 03:54:54
Done.
|
| + const int kShelfStatusAreaInset[] = {0, 5}; |
| + const int kTraySpacing[] = {4, 2}; |
| + const int kPaddingFromEdgeOfShelf[] = {3, 0}; |
| + |
| + int mode = MaterialDesignController::Mode::NON_MATERIAL; |
| + if (MaterialDesignController::IsShelfMaterial()) |
| + mode = MaterialDesignController::Mode::MATERIAL_NORMAL; |
| + |
| + switch (constant) { |
| + case ShelfStatusAreaInset::PADDING_FROM_EDGE_OF_SHELF: |
| + return kShelfStatusAreaInset[mode]; |
| + case TRAY_SPACING: |
| + return kTraySpacing[mode]; |
| + case PADDING_FROM_EDGE_TO_OVERVIEW_BUTTON: |
|
tdanderson
2016/05/26 22:55:56
nit: be consistent with the naming of the constant
yiyix
2016/06/02 03:54:53
Done.
|
| + return kPaddingFromEdgeOfShelf[mode]; |
| + } |
| + NOTREACHED(); |
| + return 0; |
| +} |
| + |
| } // namespace ash |