Skip to content

Commit 88fd9b1

Browse files
Jeroen DhollanderCommit Bot
authored andcommitted
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 <[email protected]> Commit-Queue: Jeroen Dhollander <[email protected]> Cr-Commit-Position: refs/heads/master@{#727225}
1 parent 8b85759 commit 88fd9b1

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

ash/assistant/ui/assistant_web_view.cc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,19 @@ void AssistantWebView::OnFocus() {
8686
}
8787

8888
void AssistantWebView::AboutToRequestFocusFromTabTraversal(bool reverse) {
89-
if (contents_)
89+
if (contents_) {
90+
// TODO(b/146351046): Temporary workaround for b/145213680. Should be
91+
// removed once we have moved off of the Content Service (tracked in
92+
// b/146351046).
93+
base::SequencedTaskRunnerHandle::Get()->PostTask(
94+
FROM_HERE, base::BindOnce(
95+
[](base::WeakPtr<AssistantWebView> view) {
96+
if (view)
97+
view->GetFocusManager()->ClearFocus();
98+
},
99+
weak_factory_.GetWeakPtr()));
90100
contents_->FocusThroughTabTraversal(reverse);
101+
}
91102
}
92103

93104
void AssistantWebView::InitLayout() {

0 commit comments

Comments
 (0)