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..9694f755968124bc84f661b7a873ac8ec347eab6 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,20 @@ 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; |
+ client->set_minimum_size(gfx::Size(min_width, kMinHeight)); |
+ |
+ 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 +97,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() { |