OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/bubble/bubble_dialog_delegate.h" | 5 #include "ui/views/bubble/bubble_dialog_delegate.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "ui/accessibility/ax_node_data.h" | 10 #include "ui/accessibility/ax_node_data.h" |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 if (widget == GetWidget() && anchor_widget() && | 303 if (widget == GetWidget() && anchor_widget() && |
304 anchor_widget()->GetTopLevelWidget()) { | 304 anchor_widget()->GetTopLevelWidget()) { |
305 anchor_widget()->GetTopLevelWidget()->SetAlwaysRenderAsActive(visible); | 305 anchor_widget()->GetTopLevelWidget()->SetAlwaysRenderAsActive(visible); |
306 } | 306 } |
307 | 307 |
308 // Fire AX_EVENT_ALERT for bubbles marked as AX_ROLE_ALERT_DIALOG; this | 308 // Fire AX_EVENT_ALERT for bubbles marked as AX_ROLE_ALERT_DIALOG; this |
309 // instructs accessibility tools to read the bubble in its entirety rather | 309 // instructs accessibility tools to read the bubble in its entirety rather |
310 // than just its title and initially focused view. See | 310 // than just its title and initially focused view. See |
311 // http://crbug.com/474622 for details. | 311 // http://crbug.com/474622 for details. |
312 if (widget == GetWidget() && visible) { | 312 if (widget == GetWidget() && visible) { |
313 ui::AXNodeData node_data; | 313 if (GetAccessibleWindowRole() == ui::AX_ROLE_ALERT_DIALOG) |
314 GetAccessibleNodeData(&node_data); | 314 widget->GetRootView()->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
315 if (node_data.role == ui::AX_ROLE_ALERT_DIALOG) | |
316 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | |
317 } | 315 } |
318 } | 316 } |
319 | 317 |
320 } // namespace views | 318 } // namespace views |
OLD | NEW |