Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(537)

Unified Diff: ui/message_center/views/toast_contents_view.cc

Issue 22375008: Let ChromeVox read the toast contents when it's updated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/views/toast_contents_view.cc
diff --git a/ui/message_center/views/toast_contents_view.cc b/ui/message_center/views/toast_contents_view.cc
index bb4b7d89d26efed5e60d9918d5963dec53167b66..b7dae986a20d9bc8adc2c99c6fd6fb3557d3c25d 100644
--- a/ui/message_center/views/toast_contents_view.cc
+++ b/ui/message_center/views/toast_contents_view.cc
@@ -84,10 +84,15 @@ views::Widget* ToastContentsView::CreateWidget(gfx::NativeView parent) {
}
void ToastContentsView::SetContents(MessageView* view) {
+ bool already_has_contents = child_count() > 0;
RemoveAllChildViews(true);
AddChildView(view);
preferred_size_ = GetToastSizeForView(view);
Layout();
+ // If it has the contents already, this invocation means an update of the
+ // popup toast, and the new contents should be read through a11y feature.
+ if (already_has_contents)
+ NotifyAccessibilityEvent(ui::AccessibilityTypes::EVENT_FOCUS, false);
}
void ToastContentsView::RevealWithAnimation(gfx::Point origin) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698