diff options
author | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-27 01:27:15 +0000 |
---|---|---|
committer | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-27 01:27:15 +0000 |
commit | 86eee6ebdc873f17a7acb4608aa73a17b66591c9 (patch) | |
tree | 894b048db56b916e2ef81829d144948e1c91a438 /ui | |
parent | 64d47f81da8e4529f02e4044f98f1cef549c89bb (diff) | |
download | chromium_src-86eee6ebdc873f17a7acb4608aa73a17b66591c9.zip chromium_src-86eee6ebdc873f17a7acb4608aa73a17b66591c9.tar.gz chromium_src-86eee6ebdc873f17a7acb4608aa73a17b66591c9.tar.bz2 |
Introduces a flag to suppress the spoken feedback for updating notification popups.
Sometimes notifier does countdown on notification, and update
happens every second. When the spoken feedback is on, the udpate
cancels the old notification and creates a new sound, which isn't
great.
To support such situation, a new flag is added, and this actually
suppress the spoken feedback for the update of notification popup.
This CL also fixes the behavior of display's resolution change
notification.
BUG=278572
R=dewittj@chromium.org, oshima@chromium.org
TEST=manually
Review URL: https://chromiumcodereview.appspot.com/22884016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219660 0039d316-1c4b-4281-b951-d872f2087c98
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) { |