Commit fa612fd9 authored by Steven Bennetts's avatar Steven Bennetts Committed by Commit Bot

keyboard::KeyboardController cleanup for Mash

This CL removes a call to OnTextInputStateChanged from
UpdateInputMethodObserver which could trigger a hide immediately
after a show.

Bug: 845780
Change-Id: I57e49ef011f3d3199ff9b72120d6388ebacc0847
Reviewed-on: https://chromium-review.googlesource.com/c/1338232Reviewed-by: default avatarDarren Shen <shend@chromium.org>
Commit-Queue: Steven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609413}
parent 0dbe34ab
...@@ -276,6 +276,10 @@ void KeyboardController::DisableKeyboard() { ...@@ -276,6 +276,10 @@ void KeyboardController::DisableKeyboard() {
if (parent_container_) if (parent_container_)
DeactivateKeyboard(); DeactivateKeyboard();
aura::Window* keyboard_window = GetKeyboardWindow();
if (keyboard_window)
keyboard_window->RemoveObserver(this);
// Return to the INITIAL state to ensure that transitions entering a state // Return to the INITIAL state to ensure that transitions entering a state
// is equal to transitions leaving the state. // is equal to transitions leaving the state.
if (state_ != KeyboardControllerState::INITIAL) if (state_ != KeyboardControllerState::INITIAL)
...@@ -1107,8 +1111,10 @@ void KeyboardController::UpdateInputMethodObserver() { ...@@ -1107,8 +1111,10 @@ void KeyboardController::UpdateInputMethodObserver() {
ime_observer_.RemoveAll(); ime_observer_.RemoveAll();
ime_observer_.Add(ime); ime_observer_.Add(ime);
// TODO(https://crbug.com/845780): Investigate whether this does anything. // Note: We used to call OnTextInputStateChanged(ime->GetTextInputClient())
OnTextInputStateChanged(ime->GetTextInputClient()); // here, but that can trigger HideKeyboardImplicitlyBySystem() from a call to
// ShowKeyboard() when using mojo APIs in Chrome (SingleProcessMash) if
// ime->GetTextInputClient() isn't focused.
} }
void KeyboardController::EnsureCaretInWorkArea( void KeyboardController::EnsureCaretInWorkArea(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment