Index: ash/root_window_controller.cc |
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc |
index 5fa1934d18fc2ce54b53b7df1c3748fafff22ac0..394922f871c73adba0d25179d4f88876ad6821b9 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() { |
@@ -496,6 +502,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(); |
+ keyboard_controller_.reset( |
+ new keyboard::KeyboardController(proxy)); |
+ aura::Window* keyboard_container = |
+ keyboard_controller_->GetContainerWindow(); |
+ parent->AddChild(keyboard_container); |
+ // TODO(bryeung): move this to the controller on visibility changed |
+ parent->StackChildAtTop(keyboard_container); |
+ keyboard_container->Show(); |
+ } |
+} |
+ |
+ |
//////////////////////////////////////////////////////////////////////////////// |
// RootWindowController, private: |