Commit feb758c3 authored by David Tseng's avatar David Tseng Committed by Commit Bot

Only alert accessibility when a notification's text changes

Bug: 867426
Change-Id: I7f220566f3e7a2b4ce7ef639d012f4323b762208
Reviewed-on: https://chromium-review.googlesource.com/1166231Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: David Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581474}
parent 1b7d0ee2
...@@ -65,11 +65,17 @@ MessagePopupView::MessagePopupView(PopupAlignmentDelegate* alignment_delegate, ...@@ -65,11 +65,17 @@ MessagePopupView::MessagePopupView(PopupAlignmentDelegate* alignment_delegate,
MessagePopupView::~MessagePopupView() = default; MessagePopupView::~MessagePopupView() = default;
void MessagePopupView::UpdateContents(const Notification& notification) { void MessagePopupView::UpdateContents(const Notification& notification) {
ui::AXNodeData old_data;
message_view_->GetAccessibleNodeData(&old_data);
message_view_->UpdateWithNotification(notification); message_view_->UpdateWithNotification(notification);
popup_collection_->NotifyPopupResized(); popup_collection_->NotifyPopupResized();
if (notification.rich_notification_data() if (notification.rich_notification_data()
.should_make_spoken_feedback_for_popup_updates) { .should_make_spoken_feedback_for_popup_updates) {
NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true); ui::AXNodeData new_data;
message_view_->GetAccessibleNodeData(&new_data);
if (old_data.GetStringAttribute(ax::mojom::StringAttribute::kName) !=
new_data.GetStringAttribute(ax::mojom::StringAttribute::kName))
NotifyAccessibilityEvent(ax::mojom::Event::kAlert, true);
} }
} }
......
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