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

Unified Diff: chrome/browser/ui/views/website_settings/chooser_bubble_ui_view.cc

Issue 2692113002: harmony: fix sizing on webusb chooser dialog (Closed)
Patch Set: fix non-harmony size 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 | « no previous file | ui/views/bubble/bubble_dialog_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/website_settings/chooser_bubble_ui_view.cc
diff --git a/chrome/browser/ui/views/website_settings/chooser_bubble_ui_view.cc b/chrome/browser/ui/views/website_settings/chooser_bubble_ui_view.cc
index 9addbb159e720ef07e16f56a3dee5bbbcecc0fbe..e45a3f1707108e0325db8eb5949d52794959bf7d 100644
--- a/chrome/browser/ui/views/website_settings/chooser_bubble_ui_view.cc
+++ b/chrome/browser/ui/views/website_settings/chooser_bubble_ui_view.cc
@@ -18,6 +18,7 @@
#include "chrome/browser/ui/views/exclusive_access_bubble_views.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/top_container_view.h"
+#include "chrome/browser/ui/views/harmony/layout_delegate.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/browser/ui/views/location_bar/location_icon_view.h"
#include "chrome/browser/ui/website_settings/chooser_bubble_delegate.h"
@@ -54,6 +55,7 @@ class ChooserBubbleUiViewDelegate : public views::BubbleDialogDelegateView,
bool Accept() override;
bool Cancel() override;
bool Close() override;
+ gfx::Size GetMinimumSize() const override;
// views::DialogDelegateView:
views::View* GetContentsView() override;
@@ -142,6 +144,16 @@ bool ChooserBubbleUiViewDelegate::Close() {
return true;
}
+gfx::Size ChooserBubbleUiViewDelegate::GetMinimumSize() const {
+ const int kHeight = 320;
juncai 2017/02/14 18:30:13 nit: here uses const int, and at: https://cs.chrom
Elly Fong-Jones 2017/02/14 18:35:11 Done.
+ const int kDefaultWidth = 402;
juncai 2017/02/14 18:30:13 ditto.
Elly Fong-Jones 2017/02/14 18:35:11 Done.
+ int width = LayoutDelegate::Get()->GetDialogPreferredWidth(
+ LayoutDelegate::DialogWidth::MEDIUM);
+ if (!width)
+ width = kDefaultWidth;
+ return gfx::Size(width, kHeight);
+}
+
views::View* ChooserBubbleUiViewDelegate::GetContentsView() {
return device_chooser_content_view_;
}
« no previous file with comments | « no previous file | ui/views/bubble/bubble_dialog_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698