Skip to content

Commit

Permalink
Fix tab support in Assistant settings
Browse files Browse the repository at this point in the history
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 <[email protected]>
Commit-Queue: Jeroen Dhollander <[email protected]>
Cr-Commit-Position: refs/heads/master@{#727225}
  • Loading branch information
Jeroen Dhollander authored and Commit Bot committed Dec 23, 2019
1 parent 8b85759 commit 88fd9b1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ash/assistant/ui/assistant_web_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 88fd9b1

Please sign in to comment.