Commit 88fd9b15 authored by Jeroen Dhollander's avatar Jeroen Dhollander Committed by Commit Bot

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/+/1979633Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Commit-Queue: Jeroen Dhollander <jeroendh@google.com>
Cr-Commit-Position: refs/heads/master@{#727225}
parent 8b85759b
...@@ -86,8 +86,19 @@ void AssistantWebView::OnFocus() { ...@@ -86,8 +86,19 @@ void AssistantWebView::OnFocus() {
} }
void AssistantWebView::AboutToRequestFocusFromTabTraversal(bool reverse) { 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); contents_->FocusThroughTabTraversal(reverse);
}
} }
void AssistantWebView::InitLayout() { void AssistantWebView::InitLayout() {
......
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