Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6737)

Unified Diff: chrome/browser/ui/views/device_chooser_content_view.cc

Issue 2692113002: harmony: fix sizing on webusb chooser dialog (Closed)
Patch Set: move GetPreferredSize override Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/device_chooser_content_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « chrome/browser/ui/views/device_chooser_content_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698