Chromium Code Reviews| Index: ui/keyboard/keyboard_layout_manager.cc |
| diff --git a/ui/keyboard/keyboard_layout_manager.cc b/ui/keyboard/keyboard_layout_manager.cc |
| index e29b9f0795db46669db7f927f9171152078da173..81428232c04da5ac267da1378cd81b281e5292d2 100644 |
| --- a/ui/keyboard/keyboard_layout_manager.cc |
| +++ b/ui/keyboard/keyboard_layout_manager.cc |
| @@ -5,6 +5,8 @@ |
| #include "ui/keyboard/keyboard_layout_manager.h" |
| #include "ui/compositor/layer_animator.h" |
| +#include "ui/display/display.h" |
| +#include "ui/display/screen.h" |
| #include "ui/keyboard/keyboard_controller.h" |
| #include "ui/keyboard/keyboard_util.h" |
| @@ -81,7 +83,16 @@ void KeyboardLayoutManager::SetChildBounds(aura::Window* child, |
| // The window height is set to 0 initially or before switch to an IME in a |
| // different extension. Virtual keyboard window may wait for this bounds |
| // change to correctly animate in. |
| - controller_->ShowKeyboard(controller_->keyboard_locked()); |
| + if (controller_->keyboard_locked()) { |
| + // Do not move the keyboard to another display after loading an IME. |
|
bshe
2016/12/14 16:18:28
nit: loading an IME/switch to an IME in a differen
yhanada
2016/12/15 01:10:20
Done.
|
| + const int64_t display_id = |
| + display::Screen::GetScreen() |
| + ->GetDisplayNearestWindow(controller_->GetContainerWindow()) |
| + .id(); |
| + controller_->ShowKeyboardInDisplay(display_id); |
| + } else { |
| + controller_->ShowKeyboard(false /* lock */); |
| + } |
| } else { |
| if (controller_->keyboard_mode() == FULL_WIDTH) { |
| // We need to send out this notification only if keyboard is visible since |