Chromium Code Reviews| Index: ui/views/window/dialog_delegate.cc |
| diff --git a/ui/views/window/dialog_delegate.cc b/ui/views/window/dialog_delegate.cc |
| index d98274cde71a90871a5fd96875f70838ca61cb3f..badba3d61921210a0a3f81cac1d2ecfba1c3b8da 100644 |
| --- a/ui/views/window/dialog_delegate.cc |
| +++ b/ui/views/window/dialog_delegate.cc |
| @@ -10,6 +10,7 @@ |
| #include "build/build_config.h" |
| #include "ui/accessibility/ax_view_state.h" |
| #include "ui/base/l10n/l10n_util.h" |
| +#include "ui/base/material_design/material_design_controller.h" |
| #include "ui/gfx/color_palette.h" |
| #include "ui/strings/grit/ui_strings.h" |
| #include "ui/views/bubble/bubble_border.h" |
| @@ -265,4 +266,13 @@ void DialogDelegateView::ViewHierarchyChanged( |
| NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
| } |
| +gfx::Size DialogDelegateView::GetPreferredSize() const { |
| + if (!ui::MaterialDesignController::IsSecondaryUiMaterial() || |
| + dialog_width() == DIALOG_WIDTH_UNSPECIFIED) { |
| + return View::GetPreferredSize(); |
| + } |
| + int width_px = dialog_width() * 32; |
|
Evan Stade
2016/10/03 19:04:19
actually dp, not px. I'd suggest leaving the unit
Elly Fong-Jones
2016/10/05 13:20:31
Done.
|
| + return gfx::Size(width_px, GetHeightForWidth(width_px)); |
| +} |
| + |
| } // namespace views |