Index: chrome/browser/ui/views/device_chooser_content_view.cc |
diff --git a/chrome/browser/ui/views/device_chooser_content_view.cc b/chrome/browser/ui/views/device_chooser_content_view.cc |
index 6946d8709d805ee8d7be79dbef4f24053b9f9423..c37bf3663c9a8caefa9d86dbcf4c1a24a380e908 100644 |
--- a/chrome/browser/ui/views/device_chooser_content_view.cc |
+++ b/chrome/browser/ui/views/device_chooser_content_view.cc |
@@ -7,6 +7,7 @@ |
#include "base/memory/ptr_util.h" |
#include "base/numerics/safe_conversions.h" |
#include "chrome/app/vector_icons/vector_icons.h" |
+#include "chrome/browser/ui/views/harmony/layout_delegate.h" |
#include "chrome/grit/generated_resources.h" |
#include "ui/base/l10n/l10n_util.h" |
#include "ui/base/resource/resource_bundle.h" |
@@ -110,6 +111,16 @@ void DeviceChooserContentView::Layout() { |
views::View::Layout(); |
} |
+gfx::Size DeviceChooserContentView::GetPreferredSize() const { |
+ constexpr int kHeight = 320; |
+ constexpr int kDefaultWidth = 402; |
+ int width = LayoutDelegate::Get()->GetDialogPreferredWidth( |
+ LayoutDelegate::DialogWidth::MEDIUM); |
+ if (!width) |
+ width = kDefaultWidth; |
+ return gfx::Size(width, kHeight); |
+} |
+ |
int DeviceChooserContentView::RowCount() { |
// When there are no devices, the table contains a message saying there |
// are no devices, so the number of rows is always at least 1. |