Commit b6df2ac8 authored by Dominick Ng's avatar Dominick Ng Committed by Commit Bot

Improve the accessibility of the intent picker bubble.

This CL makes several improvements to the accessibility of the intent
picker bubble:

1. Reducing the opacity applied to the ink drop highlight for focused
   items (increasing text contrast slightly)
2. Adding a role override to the bubble to avoid the screen reader
   saying "Unknown" for the picker purpose
3. Making each label button focusable so they can be tabbed through.

BUG=760200,825700

Change-Id: Ib2477b786350b07325a615f77ba4b168b1bb5cc7
Reviewed-on: https://chromium-review.googlesource.com/1102228
Commit-Queue: Dominick Ng <dominickn@chromium.org>
Reviewed-by: default avatarDavid Jacobo <djacobo@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568234}
parent 764c17f3
......@@ -13,6 +13,7 @@
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/toolbar/toolbar_ink_drop_util.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
#include "chrome/grit/generated_resources.h"
#include "components/arc/intent_helper/arc_intent_helper_bridge.h"
......@@ -82,10 +83,11 @@ class IntentPickerLabelButton : public views::LabelButton {
if (!icon->IsEmpty())
SetImage(views::ImageButton::STATE_NORMAL, *icon->ToImageSkia());
SetBorder(views::CreateEmptyBorder(8, 16, 8, 0));
SetFocusForPlatform();
set_ink_drop_base_color(SK_ColorGRAY);
set_ink_drop_visible_opacity(kToolbarInkDropVisibleOpacity);
}
SkColor GetInkDropBaseColor() const override { return SK_ColorGRAY; }
void MarkAsUnselected(const ui::Event* event) {
AnimateInkDrop(views::InkDropState::HIDDEN,
ui::LocatedEvent::FromIfValid(event));
......@@ -158,7 +160,10 @@ views::Widget* IntentPickerBubbleView::ShowBubble(
// TODO(aleventhal) Should not need to be focusable as only descendant widgets
// are interactive; however, it does call RequestFocus(). If it is going to be
// focusable, it needs an accessible name so that it can pass accessibility
// checks. Use the same accessible name as the icon.
// checks. Use the same accessible name as the icon. Set the role as kDialog
// to ensure screen readers immediately announce the text of this view.
intent_picker_bubble_->GetViewAccessibility().OverrideRole(
ax::mojom::Role::kDialog);
intent_picker_bubble_->GetViewAccessibility().OverrideName(
l10n_util::GetStringUTF16(IDS_TOOLTIP_INTENT_PICKER_ICON));
intent_picker_bubble_->SetFocusBehavior(View::FocusBehavior::ALWAYS);
......
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