Commit d9887a57 authored by Theresa's avatar Theresa Committed by Commit Bot

Make CompositorViewHolder focusable on tablets in a11y tab switcher

BUG=925277

Change-Id: I98f26b6625f399110624b0580ff191f7d55a40fa
Reviewed-on: https://chromium-review.googlesource.com/c/1437337Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Theresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626131}
parent 30b6d1d8
......@@ -26,6 +26,7 @@ import org.chromium.chrome.browser.tabmodel.TabModelSelector;
import org.chromium.chrome.browser.tabmodel.TabModelUtils;
import org.chromium.chrome.browser.widget.accessibility.AccessibilityTabModelAdapter.AccessibilityTabModelAdapterListener;
import org.chromium.chrome.browser.widget.accessibility.AccessibilityTabModelWrapper;
import org.chromium.ui.base.DeviceFormFactor;
/**
* A {@link Layout} that shows the tabs as two {@link ListView}s, one for each {@link TabModel} to
......@@ -163,7 +164,12 @@ public class OverviewListLayout extends Layout implements AccessibilityTabModelA
public boolean canHostBeFocusable() {
// TODO(https://crbug.com/918171): Consider fine-tuning accessibility support for the
// overview list layout.
return false;
// We don't allow the host to gain focus for phones so that the CompositorViewHolder doesn't
// steal focus when trying to focus the disabled tab switcher button when there are no tabs
// open (https://crbug.com/584423). This solution never worked on tablets, however, and
// caused a different focus bug, so on tablets we do allow the host to gain focus
// (https://crbug.com/925277).
return DeviceFormFactor.isNonMultiDisplayContextOnTablet(getContext());
}
@Override
......
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