| 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 9a37f8dfde652adc7b930b5d823687e6c3fcb79d..70e652c1ae0e8d9bd4d3818ad5deb21f0cdc7c7c 100644
|
| --- a/ui/base/ime/input_method_base.cc
|
| +++ b/ui/base/ime/input_method_base.cc
|
| @@ -59,6 +59,12 @@ TextInputClient* InputMethodBase::GetTextInputClient() const {
|
| return text_input_client_;
|
| }
|
|
|
| +void InputMethodBase::SetAvailableBounds(const gfx::Rect& new_bounds) {
|
| + available_bounds_ = new_bounds;
|
| + if (text_input_client_)
|
| + text_input_client_->EnsureCaretInRect(available_bounds_);
|
| +}
|
| +
|
| void InputMethodBase::OnTextInputTypeChanged(const TextInputClient* client) {
|
| if (!IsTextInputClientFocused(client))
|
| return;
|
| @@ -141,6 +147,16 @@ void InputMethodBase::SetFocusedTextInputClientInternal(
|
| text_input_client_ = client; // nullptr allowed.
|
| OnDidChangeFocusedClient(old, client);
|
| NotifyTextInputStateChanged(text_input_client_);
|
| +
|
| + if (available_bounds_.IsEmpty())
|
| + return;
|
| +
|
| + // Restore old focused window if moved.
|
| + if (old)
|
| + old->OnClientFocusLost();
|
| + // Move new focused window if necessary.
|
| + if (text_input_client_)
|
| + text_input_client_->EnsureCaretInRect(available_bounds_);
|
| }
|
|
|
| std::vector<gfx::Rect> InputMethodBase::GetCompositionBounds(
|
|
|