Chromium Code Reviews| 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 17491859c8472a95fa95bc739c24785afef98356..97c945c51160588047412d74cffb80e91b0b9faf 100644 |
| --- a/ash/common/system/tray/system_tray.cc |
| +++ b/ash/common/system/tray/system_tray.cc |
| @@ -216,6 +216,7 @@ SystemTray::SystemTray(WmShelf* wm_shelf) |
| default_bubble_height_(0), |
| hide_notifications_(false), |
| full_system_tray_menu_(false), |
| + tray_user_active_(nullptr), |
| tray_accessibility_(nullptr), |
| tray_audio_(nullptr), |
| tray_cast_(nullptr), |
| @@ -225,7 +226,12 @@ SystemTray::SystemTray(WmShelf* wm_shelf) |
| tray_update_(nullptr), |
| screen_capture_tray_item_(nullptr), |
| screen_share_tray_item_(nullptr) { |
| - SetContentsBackground(true); |
| + if (MaterialDesignController::IsShelfMaterial()) { |
| + SetInkDropMode(InkDropMode::ON); |
| + SetContentsBackground(false); |
| + } else { |
| + SetContentsBackground(true); |
| + } |
| } |
| SystemTray::~SystemTray() { |
| @@ -260,8 +266,12 @@ void SystemTray::CreateItems(SystemTrayDelegate* delegate) { |
| int maximum_user_profiles = WmShell::Get() |
| ->GetSessionStateDelegate() |
| ->GetMaximumNumberOfLoggedInUsers(); |
| - for (int i = 0; i < maximum_user_profiles; i++) |
| - AddTrayItem(new TrayUser(this, i)); |
| + for (int i = 0; i < maximum_user_profiles; i++) { |
| + TrayUser* tray_user = new TrayUser(this, i); |
| + if (i == 0) |
| + tray_user_active_ = tray_user; |
| + AddTrayItem(tray_user); |
| + } |
| // Crucially, this trailing padding has to be inside the user item(s). |
| // Otherwise it could be a main axis margin on the tray's box layout. |
| @@ -859,6 +869,20 @@ void SystemTray::ActivateBubble() { |
| bubble_view->GetWidget()->Activate(); |
| } |
| +gfx::Insets SystemTray::GetBackgroundInsets() const { |
|
bruthig
2016/11/17 06:31:20
Double check with Sebastien but I imagine we want
mohsen
2016/11/17 20:10:12
Sure. Done.
|
| + gfx::Insets insets = TrayBackgroundView::GetBackgroundInsets(); |
| + if (tray_user_active_ && tray_user_active_->is_avatar_visible()) { |
| + if (IsHorizontalAlignment(shelf_alignment())) { |
| + insets.Set(insets.top(), insets.left(), insets.bottom(), |
| + insets.right() + kTrayItemSize); |
| + } else { |
| + insets.Set(insets.top(), insets.left(), insets.bottom() + kTrayItemSize, |
| + insets.right()); |
| + } |
| + } |
| + return insets; |
| +} |
| + |
| bool SystemTray::PerformAction(const ui::Event& event) { |
| // If we're already showing the default view, hide it; otherwise, show it |
| // (and hide any popup that's currently shown). |