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

Unified Diff: ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_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, 5 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/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

Powered by Google App Engine
This is Rietveld 408576698