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

Unified Diff: ash/system/status_area_widget.cc

Issue 177123016: Add a11y virtual keyboard icon when a11y VK is enabled (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reviews and add chromeos guard for win_ash Created 6 years, 10 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/status_area_widget.cc
diff --git a/ash/system/status_area_widget.cc b/ash/system/status_area_widget.cc
index 305dab80eaba79c9a10d1c68000cc1576891d3d7..d433cf1350639e6e3ac9387250b50d0f9319c5d5 100644
--- a/ash/system/status_area_widget.cc
+++ b/ash/system/status_area_widget.cc
@@ -21,6 +21,10 @@
#include "ui/aura/window.h"
#include "ui/gfx/screen.h"
+#if defined(OS_CHROMEOS)
+#include "ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h"
+#endif // OS_CHROMEOS
+
namespace ash {
namespace internal {
@@ -32,6 +36,9 @@ StatusAreaWidget::StatusAreaWidget(aura::Window* status_container)
system_tray_(NULL),
web_notification_tray_(NULL),
logout_button_tray_(NULL),
+#if defined(OS_CHROMEOS)
+ virtual_keyboard_tray_(NULL),
+#endif // OS_CHROMEOS
login_status_(user::LOGGED_IN_NONE) {
views::Widget::InitParams params(
views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
@@ -51,6 +58,9 @@ void StatusAreaWidget::CreateTrayViews() {
AddSystemTray();
AddWebNotificationTray();
AddLogoutButtonTray();
+#if defined(OS_CHROMEOS)
+ AddVirtualKeyboardTray();
+#endif // OS_CHROMEOS
SystemTrayDelegate* delegate =
ash::Shell::GetInstance()->system_tray_delegate();
DCHECK(delegate);
@@ -61,6 +71,10 @@ void StatusAreaWidget::CreateTrayViews() {
web_notification_tray_->Initialize();
if (logout_button_tray_)
logout_button_tray_->Initialize();
+#if defined(OS_CHROMEOS)
+ if (virtual_keyboard_tray_)
+ virtual_keyboard_tray_->Initialize();
+#endif // OS_CHROMEOS
UpdateAfterLoginStatusChange(delegate->GetUserLoginStatus());
}
@@ -74,6 +88,10 @@ void StatusAreaWidget::Shutdown() {
web_notification_tray_ = NULL;
delete system_tray_;
system_tray_ = NULL;
+#if defined(OS_CHROMEOS)
+ delete virtual_keyboard_tray_;
+ virtual_keyboard_tray_ = NULL;
+#endif // OS_CHROMEOS
}
bool StatusAreaWidget::ShouldShowShelf() const {
@@ -119,6 +137,13 @@ void StatusAreaWidget::AddLogoutButtonTray() {
status_area_widget_delegate_->AddTray(logout_button_tray_);
}
+#if defined(OS_CHROMEOS)
+void StatusAreaWidget::AddVirtualKeyboardTray() {
+ virtual_keyboard_tray_ = new VirtualKeyboardTray(this);
+ status_area_widget_delegate_->AddTray(virtual_keyboard_tray_);
+}
+#endif // OS_CHROMEOS
+
void StatusAreaWidget::SetShelfAlignment(ShelfAlignment alignment) {
status_area_widget_delegate_->set_alignment(alignment);
if (system_tray_)
@@ -127,6 +152,10 @@ void StatusAreaWidget::SetShelfAlignment(ShelfAlignment alignment) {
web_notification_tray_->SetShelfAlignment(alignment);
if (logout_button_tray_)
logout_button_tray_->SetShelfAlignment(alignment);
+#if defined(OS_CHROMEOS)
+ if (virtual_keyboard_tray_)
+ virtual_keyboard_tray_->SetShelfAlignment(alignment);
+#endif // OS_CHROMEOS
status_area_widget_delegate_->UpdateLayout();
}

Powered by Google App Engine
This is Rietveld 408576698