Commit 06353073 authored by yhanada's avatar yhanada Committed by Commit bot

Do not move the on-screen keyboard to another display after loading an IME.

BUG=670617
TEST=Show the on-screen keyboard on non-touchable display and
     switch to another IME; then check that the on-screen keyboard
     remains on the same display.

Review-Url: https://codereview.chromium.org/2546963002
Cr-Commit-Position: refs/heads/master@{#443177}
parent f3704f8d
...@@ -38,7 +38,7 @@ component("keyboard") { ...@@ -38,7 +38,7 @@ component("keyboard") {
"//ui/base", "//ui/base",
"//ui/base/ime", "//ui/base/ime",
"//ui/compositor", "//ui/compositor",
"//ui/display/types:types", "//ui/display:display",
"//ui/events", "//ui/events",
"//ui/events:dom_keycode_converter", "//ui/events:dom_keycode_converter",
"//ui/events:events_base", "//ui/events:events_base",
......
...@@ -6,7 +6,7 @@ include_rules = [ ...@@ -6,7 +6,7 @@ include_rules = [
"+ui/aura", "+ui/aura",
"+ui/base", "+ui/base",
"+ui/compositor", "+ui/compositor",
"+ui/display/types", "+ui/display",
"+ui/events", "+ui/events",
"+ui/gfx", "+ui/gfx",
"+ui/gl/test/gl_surface_test_support.h", # To initialize GL for tests. "+ui/gl/test/gl_surface_test_support.h", # To initialize GL for tests.
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#include "ui/keyboard/keyboard_layout_manager.h" #include "ui/keyboard/keyboard_layout_manager.h"
#include "ui/compositor/layer_animator.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_controller.h"
#include "ui/keyboard/keyboard_util.h" #include "ui/keyboard/keyboard_util.h"
...@@ -81,7 +83,17 @@ void KeyboardLayoutManager::SetChildBounds(aura::Window* child, ...@@ -81,7 +83,17 @@ void KeyboardLayoutManager::SetChildBounds(aura::Window* child,
// The window height is set to 0 initially or before switch to an IME in a // 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 // different extension. Virtual keyboard window may wait for this bounds
// change to correctly animate in. // change to correctly animate in.
controller_->ShowKeyboard(controller_->keyboard_locked()); if (controller_->keyboard_locked()) {
// Do not move the keyboard to another display after switch to an IME in a
// different extension.
const int64_t display_id =
display::Screen::GetScreen()
->GetDisplayNearestWindow(controller_->GetContainerWindow())
.id();
controller_->ShowKeyboardInDisplay(display_id);
} else {
controller_->ShowKeyboard(false /* lock */);
}
} else { } else {
if (controller_->keyboard_mode() == FULL_WIDTH) { if (controller_->keyboard_mode() == FULL_WIDTH) {
// We need to send out this notification only if keyboard is visible since // We need to send out this notification only if keyboard is visible since
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment