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

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

Issue 2147143002: [Chrome OS MD] Draw a 1px separator between 2 tray items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 4 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/system_tray.cc
diff --git a/ash/common/system/tray/system_tray.cc b/ash/common/system/tray/system_tray.cc
index 75a6b093c7e8bcad0b1bfa15c65578d7ce865ab2..eceb6717cf4a1a04aca04f0ca28ca278c87f33b8 100644
--- a/ash/common/system/tray/system_tray.cc
+++ b/ash/common/system/tray/system_tray.cc
@@ -6,8 +6,10 @@
#include "ash/common/ash_switches.h"
#include "ash/common/login_status.h"
+#include "ash/common/material_design/material_design_controller.h"
#include "ash/common/session/session_state_delegate.h"
#include "ash/common/shelf/wm_shelf.h"
+#include "ash/common/shelf/wm_shelf_observer.h"
#include "ash/common/shelf/wm_shelf_util.h"
#include "ash/common/shell_window_ids.h"
#include "ash/common/system/cast/tray_cast.h"
@@ -73,6 +75,9 @@ namespace ash {
// The minimum width of the system tray menu width.
const int kMinimumSystemTrayMenuWidth = 300;
+// Padding used to adjust the user-visible size of status tray dark background.
+const int kBackgroundTrayPadding = 3;
+
// Class to initialize and manage the SystemTrayBubble and TrayBubbleWrapper
// instances for a bubble.
@@ -122,8 +127,8 @@ class SystemBubbleWrapper {
// SystemTray
-SystemTray::SystemTray(WmShelf* wm_shelf)
- : TrayBackgroundView(wm_shelf),
+SystemTray::SystemTray(WmShelf* wm_shelf, WmShelfObserver* wm_shelf_observer)
+ : TrayBackgroundView(wm_shelf, wm_shelf_observer),
web_notification_tray_(nullptr),
detailed_item_(nullptr),
default_bubble_height_(0),
@@ -155,6 +160,7 @@ void SystemTray::InitializeTrayItems(
DCHECK(web_notification_tray);
web_notification_tray_ = web_notification_tray;
TrayBackgroundView::Initialize();
+ AdjustStatusTrayBackground();
CreateItems(delegate);
}
@@ -627,6 +633,9 @@ void SystemTray::SetShelfAlignment(ShelfAlignment alignment) {
if (alignment == shelf_alignment())
return;
TrayBackgroundView::SetShelfAlignment(alignment);
+ if (!ash::MaterialDesignController::IsShelfMaterial()) {
varkha 2016/08/10 23:27:24 nit: no need for {}.
yiyix 2016/08/11 01:23:19 Done.
+ AdjustStatusTrayBackground();
+ }
UpdateAfterShelfAlignmentChange(alignment);
// Destroy any existing bubble so that it is rebuilt correctly.
CloseSystemBubbleAndDeactivateSystemTray();
@@ -794,4 +803,11 @@ void SystemTray::RecordSystemMenuMetrics() {
}
}
+void SystemTray::AdjustStatusTrayBackground() {
+ if (!ash::MaterialDesignController::IsShelfMaterial()) {
+ tray_container()->SetBorder(
+ views::Border::CreateEmptyBorder(gfx::Insets(kBackgroundTrayPadding)));
+ }
+}
+
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698