Chromium Code Reviews| Index: ash/display/display_controller.cc |
| diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc |
| index f34ae1fefc01e1040d4fa06bdef4002bc4a89de0..f1e643c07ada353f42db8f9cac1cd4a8df75bedd 100644 |
| --- a/ash/display/display_controller.cc |
| +++ b/ash/display/display_controller.cc |
| @@ -38,6 +38,7 @@ |
| #include "ui/aura/window_property.h" |
| #include "ui/aura/window_tracker.h" |
| #include "ui/aura/window_tree_host.h" |
| +#include "ui/base/ime/input_method_factory.h" |
| #include "ui/compositor/compositor.h" |
| #include "ui/gfx/display.h" |
| #include "ui/gfx/screen.h" |
| @@ -867,6 +868,11 @@ void DisplayController::PostDisplayConfigurationChange() { |
| UpdateMouseLocationAfterDisplayChange(); |
| } |
| +bool DisplayController::DispatchKeyEventPostIME(const ui::KeyEvent& event) { |
| + return Shell::GetTargetRootWindow()->GetHost()->DispatchKeyEventPostIME( |
|
James Cook
2015/06/02 16:29:11
Are you sure this is right? GetTargetRootWindow is
Shu Chen
2015/06/03 03:31:54
Done.
|
| + event); |
|
oshima
2015/06/02 17:35:55
James is correct. If you want to send key events t
Shu Chen
2015/06/03 03:31:54
Done.
|
| +} |
| + |
| AshWindowTreeHost* DisplayController::AddWindowTreeHostForDisplay( |
| const gfx::Display& display, |
| const AshWindowTreeHostInitParams& init_params) { |
| @@ -879,6 +885,11 @@ AshWindowTreeHost* DisplayController::AddWindowTreeHostForDisplay( |
| display.id() == DisplayManager::kUnifiedDisplayId; |
| AshWindowTreeHost* ash_host = AshWindowTreeHost::Create(params_with_bounds); |
| aura::WindowTreeHost* host = ash_host->AsWindowTreeHost(); |
| + if (!input_method_) { // Singleton input method instance for Ash. |
| + input_method_ = ui::CreateInputMethod(this, host->GetAcceleratedWidget()); |
| + input_method_->OnFocus(); |
| + } |
| + host->SetInputMethod(input_method_.get()); |
| host->window()->SetName(base::StringPrintf( |
| "%sRootWindow-%d", params_with_bounds.offscreen ? "Offscreen" : "", |