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

Unified Diff: ui/views/window/dialog_client_view.cc

Issue 2375843003: views: add Harmony dialog width support (Closed)
Patch Set: GetPreferredSize -> DialogClientView Created 4 years, 2 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
Index: ui/views/window/dialog_client_view.cc
diff --git a/ui/views/window/dialog_client_view.cc b/ui/views/window/dialog_client_view.cc
index ce9099fb3931760943a25b2c403845c99979f70e..20f11c0115f2344611a2329f141cbd582b9ea005 100644
--- a/ui/views/window/dialog_client_view.cc
+++ b/ui/views/window/dialog_client_view.cc
@@ -174,6 +174,11 @@ gfx::Size DialogClientView::GetPreferredSize() const {
size.Enlarge(0, contents_size.height());
size.set_width(std::max(size.width(), contents_size.width()));
+ // An explicit width factor overrides automatic sizing.
+ int width_factor = GetDialogDelegate()->GetWidthFactor();
+ if (width_factor != 0)
+ size = gfx::Size(width_factor * 32, size.height());
Evan Stade 2016/10/05 19:52:28 you still need to use GetHeightForWidth gfx::Size
+
return size;
}

Powered by Google App Engine
This is Rietveld 408576698