Commit 81312c86 authored by Collin Baker's avatar Collin Baker Committed by Commit Bot

Fix zoom level alert for screen readers

NVDA doesn't seem to be picking up the accessibility event on the zoom
level label. This change sends an alert event on the zoom bubble
instead.

Bug: 849472
Change-Id: I391e01bb952325b133cf9362d80c473140717a44
Reviewed-on: https://chromium-review.googlesource.com/c/1305242Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Commit-Queue: Collin Baker <collinbaker@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604800}
parent e5f43782
...@@ -273,6 +273,8 @@ ZoomBubbleView* ZoomBubbleView::GetZoomBubble() { ...@@ -273,6 +273,8 @@ ZoomBubbleView* ZoomBubbleView::GetZoomBubble() {
void ZoomBubbleView::Refresh() { void ZoomBubbleView::Refresh() {
UpdateZoomPercent(); UpdateZoomPercent();
GetWidget()->GetRootView()->NotifyAccessibilityEvent(ax::mojom::Event::kAlert,
true);
StartTimerIfNecessary(); StartTimerIfNecessary();
} }
...@@ -569,7 +571,6 @@ void ZoomBubbleView::SetExtensionInfo(const extensions::Extension* extension) { ...@@ -569,7 +571,6 @@ void ZoomBubbleView::SetExtensionInfo(const extensions::Extension* extension) {
void ZoomBubbleView::UpdateZoomPercent() { void ZoomBubbleView::UpdateZoomPercent() {
label_->SetText(base::FormatPercent( label_->SetText(base::FormatPercent(
zoom::ZoomController::FromWebContents(web_contents())->GetZoomPercent())); zoom::ZoomController::FromWebContents(web_contents())->GetZoomPercent()));
label_->NotifyAccessibilityEvent(ax::mojom::Event::kTextChanged, true);
} }
void ZoomBubbleView::UpdateZoomIconVisibility() { void ZoomBubbleView::UpdateZoomIconVisibility() {
......
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