diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/message_center/notification.cc | 7 | ||||
-rw-r--r-- | ui/message_center/notification.h | 1 | ||||
-rw-r--r-- | ui/message_center/views/toast_contents_view.cc | 16 |
3 files changed, 20 insertions, 4 deletions
diff --git a/ui/message_center/notification.cc b/ui/message_center/notification.cc index eb4c8a8..6a90e30 100644 --- a/ui/message_center/notification.cc +++ b/ui/message_center/notification.cc @@ -28,7 +28,8 @@ RichNotificationData::RichNotificationData() : priority(DEFAULT_PRIORITY), never_timeout(false), timestamp(base::Time::Now()), - progress(0) {} + progress(0), + should_make_spoken_feedback_for_popup_updates(true) {} RichNotificationData::RichNotificationData(const RichNotificationData& other) : priority(other.priority), @@ -38,7 +39,9 @@ RichNotificationData::RichNotificationData(const RichNotificationData& other) image(other.image), items(other.items), progress(other.progress), - buttons(other.buttons) {} + buttons(other.buttons), + should_make_spoken_feedback_for_popup_updates( + other.should_make_spoken_feedback_for_popup_updates) {} RichNotificationData::~RichNotificationData() {} diff --git a/ui/message_center/notification.h b/ui/message_center/notification.h index 6a742e0..915f812 100644 --- a/ui/message_center/notification.h +++ b/ui/message_center/notification.h @@ -47,6 +47,7 @@ class MESSAGE_CENTER_EXPORT RichNotificationData { std::vector<NotificationItem> items; int progress; std::vector<ButtonInfo> buttons; + bool should_make_spoken_feedback_for_popup_updates; }; class MESSAGE_CENTER_EXPORT Notification { diff --git a/ui/message_center/views/toast_contents_view.cc b/ui/message_center/views/toast_contents_view.cc index 6db7f21..93cd953 100644 --- a/ui/message_center/views/toast_contents_view.cc +++ b/ui/message_center/views/toast_contents_view.cc @@ -93,8 +93,20 @@ void ToastContentsView::SetContents(MessageView* view) { // popup toast, and the new contents should be read through a11y feature. // The notification type should be ALERT, otherwise the accessibility message // won't be read for this view which returns ROLE_WINDOW. - if (already_has_contents) - NotifyAccessibilityEvent(ui::AccessibilityTypes::EVENT_ALERT, false); + if (already_has_contents) { + const NotificationList::Notifications& notifications = + message_center_->GetNotifications(); + for (NotificationList::Notifications::const_iterator iter = + notifications.begin(); iter != notifications.end(); ++iter) { + if ((*iter)->id() != id_) + continue; + + const RichNotificationData& optional = (*iter)->rich_notification_data(); + if (optional.should_make_spoken_feedback_for_popup_updates) + NotifyAccessibilityEvent(ui::AccessibilityTypes::EVENT_ALERT, false); + break; + } + } } void ToastContentsView::RevealWithAnimation(gfx::Point origin) { |