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

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: 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..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

Powered by Google App Engine
This is Rietveld 408576698