Chromium Code Reviews| 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 492d7f9a5e06700b527e90f9f6a60b9ae97c6503..1fa36ec9f4574307b6f4374665edc15736c0d4f6 100644 |
| --- a/ui/base/ime/input_method_base.cc |
| +++ b/ui/base/ime/input_method_base.cc |
| @@ -63,6 +63,13 @@ TextInputClient* InputMethodBase::GetTextInputClient() const { |
| return text_input_client_; |
| } |
| +void InputMethodBase::SetOnScreenKeyboardBounds(const gfx::Rect& new_bounds) { |
| + LOG(ERROR) << "Called SetOnScreenKeyboardBounds: " << new_bounds.ToString(); |
|
oshima
2017/01/18 02:37:19
nit: remove debug log
yhanada
2017/01/30 13:02:47
Done.
|
| + keyboard_bounds_ = new_bounds; |
| + if (text_input_client_) |
| + text_input_client_->EnsureCaretNotInRect(keyboard_bounds_); |
| +} |
| + |
| void InputMethodBase::OnTextInputTypeChanged(const TextInputClient* client) { |
| if (!IsTextInputClientFocused(client)) |
| return; |
| @@ -146,12 +153,22 @@ void InputMethodBase::NotifyTextInputCaretBoundsChanged( |
| void InputMethodBase::SetFocusedTextInputClientInternal( |
| TextInputClient* client) { |
| TextInputClient* old = text_input_client_; |
| + LOG(ERROR) << "Called SetFocusedTextInputClientInternal: old = " << old |
| + << ", new = " << client; |
|
oshima
2017/01/18 02:37:19
nit: debug log
yhanada
2017/01/30 13:02:47
Done.
|
| + |
| if (old == client) |
| return; |
| OnWillChangeFocusedClient(old, client); |
| 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( |