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

Unified Diff: ash/root_window_controller.cc

Issue 13164002: Create and show the virtual keyboard. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ready to go Created 7 years, 9 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/root_window_controller.cc
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index 3af8f489002c05f1b530354e6ab9b435037b7505..4789e0aaf8fc1a71091a61550801e30e05cc5842 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -49,6 +49,8 @@
#include "ui/base/models/menu_model.h"
#include "ui/gfx/display.h"
#include "ui/gfx/screen.h"
+#include "ui/keyboard/keyboard_controller.h"
+#include "ui/keyboard/keyboard_util.h"
#include "ui/views/controls/menu/menu_runner.h"
#include "ui/views/corewm/visibility_controller.h"
#include "ui/views/view_model.h"
@@ -290,6 +292,10 @@ void RootWindowController::InitForPrimaryDisplay() {
}
if (Shell::GetInstance()->delegate()->IsUserLoggedIn())
shelf_->CreateLauncher();
+
+ // TODO(bryeung): Move this to CreateContainersInRootWindow when the
+ // keyboard controller will take care of deferring creation of the keyboard.
+ InitKeyboard();
}
void RootWindowController::CreateContainers() {
@@ -491,6 +497,24 @@ bool RootWindowController::IsImmersiveMode() const {
return false;
}
+void RootWindowController::InitKeyboard() {
+ if (keyboard::IsKeyboardEnabled()) {
+ aura::Window* parent = root_window();
+
+ keyboard::KeyboardControllerProxy* proxy =
+ Shell::GetInstance()->delegate()->CreateKeyboardControllerProxy();
sadrul 2013/04/04 22:08:25 indent 2 more spaces
bryeung 2013/04/05 12:29:38 Done.
+ keyboard_controller_.reset(
+ new keyboard::KeyboardController(proxy));
+ aura::Window* keyboard_container =
+ keyboard_controller_->GetContainerWindow();
sadrul 2013/04/04 22:08:25 ditto
bryeung 2013/04/05 12:29:38 Done.
+ parent->AddChild(keyboard_container);
+ // TODO(bryeung): move this to the controller on visibility changed
+ parent->StackChildAtTop(keyboard_container);
+ keyboard_container->Show();
+ }
+}
+
+
////////////////////////////////////////////////////////////////////////////////
// RootWindowController, private:

Powered by Google App Engine
This is Rietveld 408576698