Chromium Code Reviews| Index: chrome/browser/ui/views/extensions/chooser_dialog_view.cc |
| diff --git a/chrome/browser/ui/views/extensions/chooser_dialog_view.cc b/chrome/browser/ui/views/extensions/chooser_dialog_view.cc |
| index dffa13c118584bacee809b05478cd2443aae44e4..d5bbde4a4eeb8931c9676e3b34dec230831ecc8a 100644 |
| --- a/chrome/browser/ui/views/extensions/chooser_dialog_view.cc |
| +++ b/chrome/browser/ui/views/extensions/chooser_dialog_view.cc |
| @@ -11,13 +11,15 @@ |
| #include "chrome/browser/extensions/chrome_extension_chooser_dialog.h" |
| #include "chrome/browser/extensions/device_permissions_dialog_controller.h" |
| #include "chrome/browser/ui/views/device_chooser_content_view.h" |
| +#include "chrome/browser/ui/views/harmony/layout_delegate.h" |
| #include "components/constrained_window/constrained_window_views.h" |
| #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "ui/gfx/geometry/insets.h" |
| +#include "ui/views/background.h" |
| #include "ui/views/controls/link.h" |
| #include "ui/views/controls/styled_label.h" |
| -#include "ui/views/layout/layout_constants.h" |
| +#include "ui/views/layout/fill_layout.h" |
| #include "ui/views/window/dialog_client_view.h" |
| ChooserDialogView::ChooserDialogView( |
| @@ -72,7 +74,21 @@ views::View* ChooserDialogView::CreateFootnoteView() { |
| views::ClientView* ChooserDialogView::CreateClientView(views::Widget* widget) { |
| views::DialogClientView* client = |
| new views::DialogClientView(widget, GetContentsView()); |
| - client->set_button_row_insets(gfx::Insets()); |
| + |
| + constexpr int kMinWidth = 402; |
| + constexpr int kMinHeight = 320; |
| + int min_width = LayoutDelegate::Get()->GetDialogPreferredWidth( |
| + LayoutDelegate::DialogWidth::MEDIUM); |
| + if (!min_width) |
| + min_width = kMinWidth; |
| + gfx::Size minimum_size(min_width, kMinHeight); |
|
Peter Kasting
2017/02/07 23:24:44
Nit: Can inline into next statement
Elly Fong-Jones
2017/02/08 14:59:02
Done.
|
| + client->set_minimum_size(minimum_size); |
| + |
| + LayoutDelegate* delegate = LayoutDelegate::Get(); |
| + client->set_button_row_insets(gfx::Insets( |
| + delegate->GetMetric( |
| + LayoutDelegate::Metric::UNRELATED_CONTROL_VERTICAL_SPACING), |
| + 0, 0, 0)); |
| return client; |
| } |
| @@ -82,8 +98,8 @@ views::NonClientFrameView* ChooserDialogView::CreateNonClientFrameView( |
| // always be true. |
| DCHECK(ShouldUseCustomFrame()); |
| return views::DialogDelegate::CreateDialogFrameView( |
| - widget, gfx::Insets(views::kPanelVertMargin, views::kPanelHorizMargin, |
| - views::kPanelVertMargin, views::kPanelHorizMargin)); |
| + widget, gfx::Insets(LayoutDelegate::Get()->GetMetric( |
| + LayoutDelegate::Metric::PANEL_CONTENT_MARGIN))); |
| } |
| bool ChooserDialogView::Accept() { |