Commit 4123e9d8 authored by Dana Fried's avatar Dana Fried Committed by Commit Bot

Revert "Keyboard accessibility for extensions menu."

This reverts commit 91b01545.

Reason for revert: called wrong method, enabling arrow key traversal globally instead of locally

Bug: 1142343

Original change's description:
> Keyboard accessibility for extensions menu.
>
> This change switches the extensions menu to enable focus traversal at
> the focus manager level, allowing both right/left and up/down key
> traversal.
>
> It also removes
> BubbleDialogDelegateView::EnableUpDownKeyboardAccelerators() - which is
> only used in one other place - in favor of
> FocusManager::set_arrow_key_traversal_enabled(), which also supports
> left/right arrows and pre-exists the bubble dialog method.
>
> These changes mean that when the scroll pane is active in either dialog,
> up and down will scroll the pane but left and right arrow keys will
> still allow the user to traverse the dialog (at least on Windows and
> Linux; on Mac, up/down may still work within the pane).
>
> Bug: 1140632
> Change-Id: I8ea5bc79e9b9ed2595e9503be1221843c50a7b3e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2487904
> Reviewed-by: Peter Boström <pbos@chromium.org>
> Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
> Commit-Queue: Dana Fried <dfried@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#820456}

TBR=dmazzoni@chromium.org,sky@chromium.org,pbos@chromium.org,dfried@chromium.org,corising@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1140632
Change-Id: I4c1d30602c132bdd3f06ab95f0215e5909373ff9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2501074
Commit-Queue: Dana Fried <dfried@chromium.org>
Reviewed-by: default avatarDana Fried <dfried@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821156}
parent fc4c9765
...@@ -87,7 +87,7 @@ ExtensionsMenuView::ExtensionsMenuView( ...@@ -87,7 +87,7 @@ ExtensionsMenuView::ExtensionsMenuView(
SetShowCloseButton(true); SetShowCloseButton(true);
SetTitle(IDS_EXTENSIONS_MENU_TITLE); SetTitle(IDS_EXTENSIONS_MENU_TITLE);
GetFocusManager()->set_arrow_key_traversal_enabled(true); EnableUpDownKeyboardAccelerators();
// Let anchor view's MenuButtonController handle the highlight. // Let anchor view's MenuButtonController handle the highlight.
set_highlight_button_when_shown(false); set_highlight_button_when_shown(false);
......
...@@ -523,7 +523,7 @@ ProfileMenuViewBase::ProfileMenuViewBase(views::Button* anchor_button, ...@@ -523,7 +523,7 @@ ProfileMenuViewBase::ProfileMenuViewBase(views::Button* anchor_button,
DCHECK(anchor_button); DCHECK(anchor_button);
anchor_button->AnimateInkDrop(views::InkDropState::ACTIVATED, nullptr); anchor_button->AnimateInkDrop(views::InkDropState::ACTIVATED, nullptr);
GetFocusManager()->set_arrow_key_traversal_enabled(true); EnableUpDownKeyboardAccelerators();
GetViewAccessibility().OverrideRole(ax::mojom::Role::kMenu); GetViewAccessibility().OverrideRole(ax::mojom::Role::kMenu);
} }
......
...@@ -736,6 +736,12 @@ void BubbleDialogDelegateView::UpdateColorsFromTheme() { ...@@ -736,6 +736,12 @@ void BubbleDialogDelegateView::UpdateColorsFromTheme() {
: nullptr); : nullptr);
} }
void BubbleDialogDelegateView::EnableUpDownKeyboardAccelerators() {
// The arrow keys can be used to tab between items.
AddAccelerator(ui::Accelerator(ui::VKEY_DOWN, ui::EF_NONE));
AddAccelerator(ui::Accelerator(ui::VKEY_UP, ui::EF_NONE));
}
void BubbleDialogDelegate::OnBubbleWidgetVisibilityChanged(bool visible) { void BubbleDialogDelegate::OnBubbleWidgetVisibilityChanged(bool visible) {
UpdateHighlightedButton(visible); UpdateHighlightedButton(visible);
......
...@@ -408,6 +408,9 @@ class VIEWS_EXPORT BubbleDialogDelegateView : public BubbleDialogDelegate, ...@@ -408,6 +408,9 @@ class VIEWS_EXPORT BubbleDialogDelegateView : public BubbleDialogDelegate,
// Perform view initialization on the contents for bubble sizing. // Perform view initialization on the contents for bubble sizing.
void Init() override; void Init() override;
// Allows the up and down arrow keys to tab between items.
void EnableUpDownKeyboardAccelerators();
private: private:
FRIEND_TEST_ALL_PREFIXES(BubbleDelegateTest, CreateDelegate); FRIEND_TEST_ALL_PREFIXES(BubbleDelegateTest, CreateDelegate);
FRIEND_TEST_ALL_PREFIXES(BubbleDelegateTest, NonClientHitTest); FRIEND_TEST_ALL_PREFIXES(BubbleDelegateTest, NonClientHitTest);
......
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