Commit 83581235 authored by Jacobo Aragunde Pérez's avatar Jacobo Aragunde Pérez Committed by Commit Bot

Fix accessibility of password bubble.

We overwrite the accessibility role of the PasswordBubbleViewBase so it
has the role that ATs expect. Having that role will trigger the code
that produces the correct events.

Bug: 1079320
AX-Relnotes: announce the save password bubble when it shows up (Linux)
Change-Id: I7e0c4b08c356488d485d3b529afbe7701e2aa5d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2190470
Commit-Queue: Jacobo Aragunde Pérez <jaragunde@igalia.com>
Reviewed-by: default avatarAaron Leventhal <aleventhal@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#794960}
parent 52fd4247
......@@ -156,6 +156,14 @@ void PasswordBubbleViewBase::Init() {
SetShowTitle(!controller->GetTitle().empty());
}
ax::mojom::Role PasswordBubbleViewBase::GetAccessibleWindowRole() {
// This bubble is displayed as non-modal when users finish typing their
// password. In absence of a focus change event, ATs will not notice the
// bubble unless an alert event is emitted, so we need it to have an
// alert role.
return ax::mojom::Role::kAlertDialog;
}
void PasswordBubbleViewBase::OnWidgetClosing(views::Widget* widget) {
LocationBarBubbleDelegateView::OnWidgetClosing(widget);
if (widget != GetWidget())
......
......@@ -66,6 +66,9 @@ class PasswordBubbleViewBase : public LocationBarBubbleDelegateView {
~PasswordBubbleViewBase() override;
// views::BubbleDialogDelegateView:
ax::mojom::Role GetAccessibleWindowRole() override;
private:
// views::BubbleDialogDelegateView:
void Init() 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