Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: ui/views/window/dialog_delegate.cc

Issue 2850533003: Log the creation of a dialog boxes using DialogDelegate. (Closed)
Patch Set: Use BooleanCreated enum for Dialog.Delegate.Creation Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/metrics/histograms/histograms.xml ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "build/build_config.h" 11 #include "build/build_config.h"
11 #include "ui/accessibility/ax_node_data.h" 12 #include "ui/accessibility/ax_node_data.h"
12 #include "ui/base/l10n/l10n_util.h" 13 #include "ui/base/l10n/l10n_util.h"
13 #include "ui/gfx/color_palette.h" 14 #include "ui/gfx/color_palette.h"
14 #include "ui/strings/grit/ui_strings.h" 15 #include "ui/strings/grit/ui_strings.h"
15 #include "ui/views/bubble/bubble_border.h" 16 #include "ui/views/bubble/bubble_border.h"
16 #include "ui/views/bubble/bubble_frame_view.h" 17 #include "ui/views/bubble/bubble_frame_view.h"
17 #include "ui/views/controls/button/label_button.h" 18 #include "ui/views/controls/button/label_button.h"
18 #include "ui/views/layout/layout_constants.h" 19 #include "ui/views/layout/layout_constants.h"
19 #include "ui/views/layout/layout_provider.h" 20 #include "ui/views/layout/layout_provider.h"
20 #include "ui/views/style/platform_style.h" 21 #include "ui/views/style/platform_style.h"
21 #include "ui/views/widget/widget.h" 22 #include "ui/views/widget/widget.h"
22 #include "ui/views/widget/widget_observer.h" 23 #include "ui/views/widget/widget_observer.h"
23 #include "ui/views/window/dialog_client_view.h" 24 #include "ui/views/window/dialog_client_view.h"
24 25
25 #if defined(OS_WIN) 26 #if defined(OS_WIN)
26 #include "ui/base/win/shell.h" 27 #include "ui/base/win/shell.h"
27 #endif 28 #endif
28 29
29 namespace views { 30 namespace views {
30 31
31 //////////////////////////////////////////////////////////////////////////////// 32 ////////////////////////////////////////////////////////////////////////////////
32 // DialogDelegate: 33 // DialogDelegate:
33 34
34 DialogDelegate::DialogDelegate() : supports_custom_frame_(true) {} 35 DialogDelegate::DialogDelegate() : supports_custom_frame_(true) {
36 UMA_HISTOGRAM_BOOLEAN("Dialog.Delegate.Creation", true);
37 }
35 38
36 DialogDelegate::~DialogDelegate() {} 39 DialogDelegate::~DialogDelegate() {}
37 40
38 // static 41 // static
39 Widget* DialogDelegate::CreateDialogWidget(WidgetDelegate* delegate, 42 Widget* DialogDelegate::CreateDialogWidget(WidgetDelegate* delegate,
40 gfx::NativeWindow context, 43 gfx::NativeWindow context,
41 gfx::NativeView parent) { 44 gfx::NativeView parent) {
42 views::Widget* widget = new views::Widget; 45 views::Widget* widget = new views::Widget;
43 views::Widget::InitParams params = 46 views::Widget::InitParams params =
44 GetDialogWidgetInitParams(delegate, context, parent, gfx::Rect()); 47 GetDialogWidgetInitParams(delegate, context, parent, gfx::Rect());
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 node_data->role = ui::AX_ROLE_DIALOG; 264 node_data->role = ui::AX_ROLE_DIALOG;
262 } 265 }
263 266
264 void DialogDelegateView::ViewHierarchyChanged( 267 void DialogDelegateView::ViewHierarchyChanged(
265 const ViewHierarchyChangedDetails& details) { 268 const ViewHierarchyChangedDetails& details) {
266 if (details.is_add && details.child == this && GetWidget()) 269 if (details.is_add && details.child == this && GetWidget())
267 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); 270 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true);
268 } 271 }
269 272
270 } // namespace views 273 } // namespace views
OLDNEW
« no previous file with comments | « tools/metrics/histograms/histograms.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698