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

Unified Diff: ui/views/window/dialog_delegate.cc

Issue 691703002: Modified DialogDelegateView to be accessible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a check to GetWidget() as well Created 6 years, 2 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 | « ui/views/window/dialog_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/dialog_delegate.cc
diff --git a/ui/views/window/dialog_delegate.cc b/ui/views/window/dialog_delegate.cc
index 1627a8f2272c898457819b4b22237ff01646ff48..ce68914c8efa12e51bc6e2ce08cf5af075461d3e 100644
--- a/ui/views/window/dialog_delegate.cc
+++ b/ui/views/window/dialog_delegate.cc
@@ -5,6 +5,7 @@
#include "ui/views/window/dialog_delegate.h"
#include "base/logging.h"
+#include "ui/accessibility/ax_view_state.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/bubble/bubble_border.h"
@@ -238,4 +239,15 @@ View* DialogDelegateView::GetContentsView() {
return this;
}
+void DialogDelegateView::GetAccessibleState(ui::AXViewState* state) {
+ state->name = GetDialogTitle();
+ state->role = ui::AX_ROLE_DIALOG;
+}
+
+void DialogDelegateView::ViewHierarchyChanged(
+ const ViewHierarchyChangedDetails& details) {
+ if (details.is_add && details.child == this && GetWidget())
+ NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true);
+}
+
} // namespace views
« no previous file with comments | « ui/views/window/dialog_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698