Index: ui/keyboard/keyboard_controller_proxy.cc |
diff --git a/ui/keyboard/keyboard_controller_proxy.cc b/ui/keyboard/keyboard_controller_proxy.cc |
index 4a0dd4f6fe2010ffc0e83b42ee05e488e4b5f9e5..f1df00499f915f9eb2c06ab471122b43118b8461 100644 |
--- a/ui/keyboard/keyboard_controller_proxy.cc |
+++ b/ui/keyboard/keyboard_controller_proxy.cc |
@@ -15,6 +15,8 @@ |
#include "content/public/common/bindings_policy.h" |
#include "ui/aura/layout_manager.h" |
#include "ui/aura/window.h" |
+#include "ui/base/ime/input_method.h" |
+#include "ui/base/ime/text_input_client.h" |
#include "ui/keyboard/keyboard_constants.h" |
#include "ui/keyboard/keyboard_switches.h" |
#include "ui/keyboard/keyboard_util.h" |
@@ -142,6 +144,15 @@ void KeyboardControllerProxy::SetUpdateInputType(ui::TextInputType type) { |
} |
void KeyboardControllerProxy::EnsureCaretInWorkArea() { |
+ if (GetInputMethod()->GetTextInputClient()) { |
+ aura::Window* keyboard_window = GetKeyboardWindow(); |
+ aura::Window* root_window = keyboard_window->GetRootWindow(); |
+ gfx::Rect available_bounds = root_window->bounds(); |
+ gfx::Rect keyboard_bounds = keyboard_window->bounds(); |
+ available_bounds.set_height(available_bounds.height() - |
+ keyboard_bounds.height()); |
+ GetInputMethod()->GetTextInputClient()->EnsureCaretInRect(available_bounds); |
+ } |
} |
void KeyboardControllerProxy::LoadSystemKeyboard() { |