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

Unified Diff: ash/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 & Refactor border around item implementation Created 4 years, 7 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/system/tray/tray_constants.cc
diff --git a/ash/system/tray/tray_constants.cc b/ash/system/tray/tray_constants.cc
index 8557e2e38f2a5888371a9fe38d0c03701522922f..bc2bed14eb43e46307705e86cc8df6e719f49906 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,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;
@@ -81,7 +84,27 @@ const int kTrayNotificationContentsWidth = kTrayPopupMinWidth -
const int kTrayAvatarCornerRadius = 2;
const int kTrayAvatarSize = 32;
-const int kTraySpacing = 4;
+const int kMessageCenterBubblePadding = 4;
const int kShelfItemHeight = 38;
+const int kOverviewButtonIndex = 0;
+
+// static
tdanderson 2016/06/03 19:25:24 nit: remove this if the function isn't static
yiyix 2016/06/10 19:26:05 Sorry, I copied this over from another function
+int GetTrayConstant(ShelfStatusAreaInset constant) {
+ const int kTraySpacing[] = {4, 2};
+ const int kPaddingFromEdgeOfShelf[] = {3, 5};
+
+ int mode = MaterialDesignController::IsShelfMaterial()
+ ? MaterialDesignController::Mode::MATERIAL_NORMAL
+ : MaterialDesignController::Mode::NON_MATERIAL;
+
+ 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