Commit 72fcd602 authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

arc: ime: Restore ARC IME focus after CustomTabs.

Because of CustomTab, it is possible for ARC IME to lose IME focus even
though window focus does not change. To prevent that, we should ensure
the IME focus is set again when the custom tab child window is removed.

TEST=manual(Open a custom tab in Gmail, type something in web contents,
close the tab, and type again in Gmail search box in the app.)
BUG=b:135281220

Change-Id: I7ee383cdf952c349264725e5691323ce0ee609fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1752272Reviewed-by: default avatarYuichiro Hanada <yhanada@chromium.org>
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686710}
parent 48e53357
...@@ -253,6 +253,13 @@ void ArcImeService::OnWindowPropertyChanged(aura::Window* window, ...@@ -253,6 +253,13 @@ void ArcImeService::OnWindowPropertyChanged(aura::Window* window,
} }
} }
void ArcImeService::OnWindowRemoved(aura::Window* removed_window) {
// |this| can lose the IME focus because |focused_arc_window_| may have
// children other than ExoSurface e.g. WebContentsViewAura for CustomTabs.
// Restore the IME focus when such a window is removed.
ReattachInputMethod(nullptr, focused_arc_window_);
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Overridden from exo::WMHelper::FocusChangeObserver: // Overridden from exo::WMHelper::FocusChangeObserver:
......
...@@ -84,6 +84,7 @@ class ArcImeService : public KeyedService, ...@@ -84,6 +84,7 @@ class ArcImeService : public KeyedService,
void OnWindowPropertyChanged(aura::Window* window, void OnWindowPropertyChanged(aura::Window* window,
const void* key, const void* key,
intptr_t old) override; intptr_t old) override;
void OnWindowRemoved(aura::Window* removed_window) override;
// Overridden from aura::client::FocusChangeObserver: // Overridden from aura::client::FocusChangeObserver:
void OnWindowFocused(aura::Window* gained_focus, void OnWindowFocused(aura::Window* gained_focus,
......
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