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

Unified Diff: ash/common/system/tray/tray_constants.cc

Issue 1998933002: Update shelf spacing in Chrome OS according to the MD specs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments from @tdanderson Created 4 years, 6 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
Index: ash/common/system/tray/tray_constants.cc
diff --git a/ash/common/system/tray/tray_constants.cc b/ash/common/system/tray/tray_constants.cc
index 90c6aa9df50fd9dedda9fc785145501fee177bd5..58f410ba68d235c8a5fe16b3e42ab3303da9bff8 100644
--- a/ash/common/system/tray/tray_constants.cc
+++ b/ash/common/system/tray/tray_constants.cc
@@ -4,6 +4,8 @@
#include "ash/common/system/tray/tray_constants.h"
+#include "ash/common/material_design/material_design_controller.h"
+#include "base/logging.h"
#include "third_party/skia/include/core/SkColor.h"
namespace ash {
@@ -20,7 +22,8 @@ const int kBubblePaddingHorizontalSide = 10;
const int kBubblePaddingVerticalBottom = 3;
const int kBubblePaddingVerticalSide = 15;
-const int kPaddingFromEdgeOfShelf = 3;
+// Padding used to adjust the size of status tray dark background.
+const int kAdjustBackgroundPadding = 3;
// Top inset of system tray bubble for bottom anchor alignment.
const int kTrayBubbleAnchorTopInsetBottomAnchor = 3;
@@ -80,7 +83,28 @@ const int kTrayNotificationContentsWidth = kTrayPopupMinWidth -
const int kTrayAvatarCornerRadius = 2;
const int kTrayAvatarSize = 32;
-const int kTraySpacing = 4;
+const int kMessageCenterBubblePadding = 4;
const int kShelfItemHeight = 38;
+// Items are 32 by 32 in the new Chrome OS MD requirements.
+const int kShelfItemSizeMD = 32;
+
+int GetTrayConstant(ShelfStatusAreaInset constant) {
+ const int kTraySpacing[] = {4, 8, 8};
+ const int kPaddingFromEdgeOfShelf[] = {3, 8, 8};
+
+ const int mode = MaterialDesignController::GetMode();
+ DCHECK(mode >= MaterialDesignController::NON_MATERIAL &&
+ mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL);
+
+ switch (constant) {
+ case TRAY_SPACING:
+ return kTraySpacing[mode];
+ case PADDING_FROM_EDGE_OF_SHELF:
+ return kPaddingFromEdgeOfShelf[mode];
+ }
+ NOTREACHED();
+ return 0;
+}
+
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698