Chromium Code Reviews| Index: ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc |
| diff --git a/ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc b/ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc |
| index 5e2391ff8370638d3d2e99f623ed125764b3276c..953134213c3284c0191a199875d36aab00cc9621 100644 |
| --- a/ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc |
| +++ b/ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc |
| @@ -9,7 +9,9 @@ |
| #include "ash/common/keyboard/keyboard_ui.h" |
| #include "ash/common/material_design/material_design_controller.h" |
| #include "ash/common/shelf/shelf_constants.h" |
| +#include "ash/common/shelf/wm_shelf.h" |
| #include "ash/common/shelf/wm_shelf_util.h" |
| +#include "ash/common/system/chromeos/session/logout_button_tray.h" |
| #include "ash/common/system/tray/tray_constants.h" |
| #include "ash/common/system/tray/tray_utils.h" |
| #include "ash/common/wm_shell.h" |
| @@ -26,7 +28,9 @@ |
| namespace ash { |
| VirtualKeyboardTray::VirtualKeyboardTray(WmShelf* wm_shelf) |
| - : TrayBackgroundView(wm_shelf), button_(nullptr) { |
| + : TrayBackgroundView(wm_shelf), |
| + button_(nullptr), |
| + logout_button_tray_(nullptr) { |
| button_ = new views::ImageButton(this); |
| if (MaterialDesignController::IsShelfMaterial()) { |
| gfx::ImageSkia image_md = |
| @@ -55,9 +59,19 @@ VirtualKeyboardTray::~VirtualKeyboardTray() { |
| WmShell::Get()->keyboard_ui()->RemoveObserver(this); |
| } |
| +void VirtualKeyboardTray::Shutdown() { |
| + DCHECK(logout_button_tray_); |
| + logout_button_tray_ = nullptr; |
| +} |
| + |
| +void VirtualKeyboardTray::InitializeTrayItems( |
| + LogoutButtonTray* logout_button_tray) { |
| + logout_button_tray_ = logout_button_tray; |
| + TrayBackgroundView::Initialize(); |
| +} |
| + |
| void VirtualKeyboardTray::SetShelfAlignment(ShelfAlignment alignment) { |
| TrayBackgroundView::SetShelfAlignment(alignment); |
| - tray_container()->SetBorder(views::Border::NullBorder()); |
| // Pad button size to align with other controls in the system tray. |
| const gfx::ImageSkia image = |
| @@ -102,4 +116,12 @@ void VirtualKeyboardTray::OnKeyboardEnabledStateChanged(bool new_value) { |
| SetVisible(WmShell::Get()->keyboard_ui()->IsEnabled()); |
| } |
| +void VirtualKeyboardTray::OnPaint(gfx::Canvas* canvas) { |
| + // Paints a 1px separator to separate with the tray to the right. No separator |
| + // requires in front of Logout Button because it is red and appealing by |
|
varkha
2016/07/14 21:34:46
How about:
Paints a line to separate from the subs
yiyix
2016/07/26 20:27:30
No need to emphasize that the separator is 1px? I
|
| + // itself. |
| + if (!logout_button_tray_->visible()) |
| + DrawSeparator(canvas); |
| +} |
| + |
| } // namespace ash |