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

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: new png resources and new button size 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
« no previous file with comments | « ash/system/status_area_widget.h ('k') | ui/keyboard/keyboard_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4eda2fb7bb45e5348527718ec946f174e0d97ee0 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
+
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
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
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
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
}
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
+
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
status_area_widget_delegate_->UpdateLayout();
}
« no previous file with comments | « ash/system/status_area_widget.h ('k') | ui/keyboard/keyboard_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698