Index: ui/base/ime/input_method_base.cc |
diff --git a/ui/base/ime/input_method_base.cc b/ui/base/ime/input_method_base.cc |
index 9d43d8523a85811d2a7569d0a9463abc95c59f48..a306a780688acdda7fd66294d6f2c1104fd6abe9 100644 |
--- a/ui/base/ime/input_method_base.cc |
+++ b/ui/base/ime/input_method_base.cc |
@@ -58,6 +58,12 @@ TextInputClient* InputMethodBase::GetTextInputClient() const { |
return text_input_client_; |
} |
+void InputMethodBase::SetOnScreenKeyboardBounds(const gfx::Rect& new_bounds) { |
+ keyboard_bounds_ = new_bounds; |
+ if (text_input_client_) |
+ text_input_client_->EnsureCaretNotInRect(keyboard_bounds_); |
+} |
+ |
void InputMethodBase::OnTextInputTypeChanged(const TextInputClient* client) { |
if (!IsTextInputClientFocused(client)) |
return; |
@@ -147,6 +153,13 @@ void InputMethodBase::SetFocusedTextInputClientInternal( |
text_input_client_ = client; // nullptr allowed. |
OnDidChangeFocusedClient(old, client); |
NotifyTextInputStateChanged(text_input_client_); |
+ |
+ // Restore old focused window if moved. |
+ if (old) |
+ old->OnClientFocusLost(); |
+ // Move new focused window if necessary. |
+ if (text_input_client_) |
+ text_input_client_->EnsureCaretNotInRect(keyboard_bounds_); |
} |
std::vector<gfx::Rect> InputMethodBase::GetCompositionBounds( |