Chromium Code Reviews| 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 "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); | |
|
msw
2017/05/01 21:51:30
Why BOOLEAN? Shouldn't this be UMA_HISTOGRAM_COUNT
jwd
2017/05/03 20:14:40
No, it's confusing naming. UMA_HISTOGRAM_COUNTS_*
msw
2017/05/03 22:53:22
Acknowledged.
| |
| 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 Loading... | |
| 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 |
| OLD | NEW |