| 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..a005d79095973d795552270b3fd561b0042db857 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::set_available_bounds(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,19 @@ void InputMethodBase::SetFocusedTextInputClientInternal(
|
| text_input_client_ = client; // nullptr allowed.
|
| OnDidChangeFocusedClient(old, client);
|
| NotifyTextInputStateChanged(text_input_client_);
|
| +
|
| + if (available_bounds_.IsEmpty())
|
| + return;
|
| +
|
| + if (old) {
|
| + LOG(ERROR) << "move old window";
|
| + old->EnsureCaretInRect(available_bounds_);
|
| + }
|
| + if (text_input_client_) {
|
| + LOG(ERROR) << "set focus, available bounds: "
|
| + << available_bounds_.ToString();
|
| + text_input_client_->EnsureCaretInRect(available_bounds_);
|
| + }
|
| }
|
|
|
| std::vector<gfx::Rect> InputMethodBase::GetCompositionBounds(
|
|
|