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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 ui::AXRole DialogDelegate::GetAccessibleWindowRole() const { | 236 ui::AXRole DialogDelegate::GetAccessibleWindowRole() const { |
237 return ui::AX_ROLE_DIALOG; | 237 return ui::AX_ROLE_DIALOG; |
238 } | 238 } |
239 | 239 |
240 //////////////////////////////////////////////////////////////////////////////// | 240 //////////////////////////////////////////////////////////////////////////////// |
241 // DialogDelegateView: | 241 // DialogDelegateView: |
242 | 242 |
243 DialogDelegateView::DialogDelegateView() { | 243 DialogDelegateView::DialogDelegateView() { |
244 // A WidgetDelegate should be deleted on DeleteDelegate. | 244 // A WidgetDelegate should be deleted on DeleteDelegate. |
245 set_owned_by_client(); | 245 set_owned_by_client(); |
| 246 UMA_HISTOGRAM_BOOLEAN("Dialog.DialogDelegateView.Create", true); |
246 } | 247 } |
247 | 248 |
248 DialogDelegateView::~DialogDelegateView() {} | 249 DialogDelegateView::~DialogDelegateView() {} |
249 | 250 |
250 void DialogDelegateView::DeleteDelegate() { | 251 void DialogDelegateView::DeleteDelegate() { |
251 delete this; | 252 delete this; |
252 } | 253 } |
253 | 254 |
254 Widget* DialogDelegateView::GetWidget() { | 255 Widget* DialogDelegateView::GetWidget() { |
255 return View::GetWidget(); | 256 return View::GetWidget(); |
(...skipping 12 matching lines...) Expand all Loading... |
268 node_data->role = ui::AX_ROLE_DIALOG; | 269 node_data->role = ui::AX_ROLE_DIALOG; |
269 } | 270 } |
270 | 271 |
271 void DialogDelegateView::ViewHierarchyChanged( | 272 void DialogDelegateView::ViewHierarchyChanged( |
272 const ViewHierarchyChangedDetails& details) { | 273 const ViewHierarchyChangedDetails& details) { |
273 if (details.is_add && details.child == this && GetWidget()) | 274 if (details.is_add && details.child == this && GetWidget()) |
274 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 275 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
275 } | 276 } |
276 | 277 |
277 } // namespace views | 278 } // namespace views |
OLD | NEW |