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 15 matching lines...) Expand all Loading... | |
26 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
27 #include "ui/base/win/shell.h" | 27 #include "ui/base/win/shell.h" |
28 #endif | 28 #endif |
29 | 29 |
30 namespace views { | 30 namespace views { |
31 | 31 |
32 //////////////////////////////////////////////////////////////////////////////// | 32 //////////////////////////////////////////////////////////////////////////////// |
33 // DialogDelegate: | 33 // DialogDelegate: |
34 | 34 |
35 DialogDelegate::DialogDelegate() : supports_custom_frame_(true) { | 35 DialogDelegate::DialogDelegate() : supports_custom_frame_(true) { |
36 UMA_HISTOGRAM_BOOLEAN("Dialog.Delegate.Creation", true); | 36 UMA_HISTOGRAM_BOOLEAN("Dialog.Delegate.Creation", true); |
msw
2017/05/11 00:54:40
nit: maybe this should be Dialog.DialogDelegate.Cr
| |
37 } | 37 } |
38 | 38 |
39 DialogDelegate::~DialogDelegate() {} | 39 DialogDelegate::~DialogDelegate() {} |
40 | 40 |
41 // static | 41 // static |
42 Widget* DialogDelegate::CreateDialogWidget(WidgetDelegate* delegate, | 42 Widget* DialogDelegate::CreateDialogWidget(WidgetDelegate* delegate, |
43 gfx::NativeWindow context, | 43 gfx::NativeWindow context, |
44 gfx::NativeView parent) { | 44 gfx::NativeView parent) { |
45 views::Widget* widget = new views::Widget; | 45 views::Widget* widget = new views::Widget; |
46 views::Widget::InitParams params = | 46 views::Widget::InitParams params = |
(...skipping 185 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.Create", true); | |
msw
2017/05/11 00:54:40
nit: maybe this should be Dialog.DialogDelegateVie
pdyson
2017/05/11 05:54:01
Done.
I have another cl to change Dialog.Delegate
| |
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 |