OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/window/dialog_delegate.h" | 5 #include "ui/views/window/dialog_delegate.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ui/accessibility/ax_view_state.h" |
8 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
9 #include "ui/strings/grit/ui_strings.h" | 10 #include "ui/strings/grit/ui_strings.h" |
10 #include "ui/views/bubble/bubble_border.h" | 11 #include "ui/views/bubble/bubble_border.h" |
11 #include "ui/views/bubble/bubble_frame_view.h" | 12 #include "ui/views/bubble/bubble_frame_view.h" |
12 #include "ui/views/controls/button/label_button.h" | 13 #include "ui/views/controls/button/label_button.h" |
13 #include "ui/views/widget/widget.h" | 14 #include "ui/views/widget/widget.h" |
14 #include "ui/views/widget/widget_observer.h" | 15 #include "ui/views/widget/widget_observer.h" |
15 #include "ui/views/window/dialog_client_view.h" | 16 #include "ui/views/window/dialog_client_view.h" |
16 | 17 |
17 #if defined(OS_WIN) | 18 #if defined(OS_WIN) |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 } | 232 } |
232 | 233 |
233 const Widget* DialogDelegateView::GetWidget() const { | 234 const Widget* DialogDelegateView::GetWidget() const { |
234 return View::GetWidget(); | 235 return View::GetWidget(); |
235 } | 236 } |
236 | 237 |
237 View* DialogDelegateView::GetContentsView() { | 238 View* DialogDelegateView::GetContentsView() { |
238 return this; | 239 return this; |
239 } | 240 } |
240 | 241 |
| 242 void DialogDelegateView::GetAccessibleState(ui::AXViewState* state) { |
| 243 state->name = GetDialogTitle(); |
| 244 state->role = ui::AX_ROLE_DIALOG; |
| 245 } |
| 246 |
| 247 void DialogDelegateView::ViewHierarchyChanged( |
| 248 const ViewHierarchyChangedDetails& details) { |
| 249 if (details.is_add && details.child == this && GetWidget()) |
| 250 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
| 251 } |
| 252 |
241 } // namespace views | 253 } // namespace views |
OLD | NEW |