| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 ui::AXRole DialogDelegate::GetAccessibleWindowRole() const { | 232 ui::AXRole DialogDelegate::GetAccessibleWindowRole() const { |
| 233 return ui::AX_ROLE_DIALOG; | 233 return ui::AX_ROLE_DIALOG; |
| 234 } | 234 } |
| 235 | 235 |
| 236 //////////////////////////////////////////////////////////////////////////////// | 236 //////////////////////////////////////////////////////////////////////////////// |
| 237 // DialogDelegateView: | 237 // DialogDelegateView: |
| 238 | 238 |
| 239 DialogDelegateView::DialogDelegateView() { | 239 DialogDelegateView::DialogDelegateView() { |
| 240 // A WidgetDelegate should be deleted on DeleteDelegate. | 240 // A WidgetDelegate should be deleted on DeleteDelegate. |
| 241 set_owned_by_client(); | 241 set_owned_by_client(); |
| 242 UMA_HISTOGRAM_BOOLEAN("Dialog.DelegateView.Creation", true); |
| 242 } | 243 } |
| 243 | 244 |
| 244 DialogDelegateView::~DialogDelegateView() {} | 245 DialogDelegateView::~DialogDelegateView() {} |
| 245 | 246 |
| 246 void DialogDelegateView::DeleteDelegate() { | 247 void DialogDelegateView::DeleteDelegate() { |
| 247 delete this; | 248 delete this; |
| 248 } | 249 } |
| 249 | 250 |
| 250 Widget* DialogDelegateView::GetWidget() { | 251 Widget* DialogDelegateView::GetWidget() { |
| 251 return View::GetWidget(); | 252 return View::GetWidget(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 264 node_data->role = ui::AX_ROLE_DIALOG; | 265 node_data->role = ui::AX_ROLE_DIALOG; |
| 265 } | 266 } |
| 266 | 267 |
| 267 void DialogDelegateView::ViewHierarchyChanged( | 268 void DialogDelegateView::ViewHierarchyChanged( |
| 268 const ViewHierarchyChangedDetails& details) { | 269 const ViewHierarchyChangedDetails& details) { |
| 269 if (details.is_add && details.child == this && GetWidget()) | 270 if (details.is_add && details.child == this && GetWidget()) |
| 270 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 271 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
| 271 } | 272 } |
| 272 | 273 |
| 273 } // namespace views | 274 } // namespace views |
| OLD | NEW |