0

Fix tab support in Assistant settings

This is a temporary fix.
The real fix will be to move away from the Content Service and back to
|views::WebView|. This is tracked in b/146351046.

   - Embedded UI:
       - TAB and shift-TAB works for settings.
       - TAB and shift-TAB works for webview based Assistant response
       (to the query |weather|).
       - Open Settings, click on other window, click back on settings,
       verify TAB and shift-TAB still work.
   - Standalone UI:
       - TAB and shift-TAB works for settings.
       - TAB and shift-TAB works for webview based Assistant response
       (to the query |weather|).

Bug: 145213680
Change-Id: If0f39d4911409f177fb1f93525205ad7392bdd35
Tests: Manually tested that:
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1979633
Reviewed-by: Xiaohui Chen <xiaohuic@chromium.org>
Commit-Queue: Jeroen Dhollander <jeroendh@google.com>
Cr-Commit-Position: refs/heads/master@{#727225}
This commit is contained in:
Jeroen Dhollander
2019-12-23 19:54:30 +00:00
committed by Commit Bot
parent 8b85759ba0
commit 88fd9b151a

@ -86,8 +86,19 @@ void AssistantWebView::OnFocus() {
}
void AssistantWebView::AboutToRequestFocusFromTabTraversal(bool reverse) {
if (contents_)
if (contents_) {
// TODO(b/146351046): Temporary workaround for b/145213680. Should be
// removed once we have moved off of the Content Service (tracked in
// b/146351046).
base::SequencedTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(
[](base::WeakPtr<AssistantWebView> view) {
if (view)
view->GetFocusManager()->ClearFocus();
},
weak_factory_.GetWeakPtr()));
contents_->FocusThroughTabTraversal(reverse);
}
}
void AssistantWebView::InitLayout() {