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

Unified Diff: chrome/browser/ui/views/harmony/chrome_layout_provider.cc

Issue 2907873002: views: impose minimum width on non-Harmony snappables (Closed)
Patch Set: Created 3 years, 7 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: chrome/browser/ui/views/harmony/chrome_layout_provider.cc
diff --git a/chrome/browser/ui/views/harmony/chrome_layout_provider.cc b/chrome/browser/ui/views/harmony/chrome_layout_provider.cc
index 24988010ce0f122ed1c04a529801ffd396c6bf50..758c694f5cff214b00e9bdb8d6de8e7196fd70bb 100644
--- a/chrome/browser/ui/views/harmony/chrome_layout_provider.cc
+++ b/chrome/browser/ui/views/harmony/chrome_layout_provider.cc
@@ -77,3 +77,12 @@ bool ChromeLayoutProvider::ShouldShowWindowIcon() const {
bool ChromeLayoutProvider::IsHarmonyMode() const {
return false;
}
+
+int ChromeLayoutProvider::GetSnappedDialogWidth(int min_width) const {
+ // This is an arbitrary value, but it's a good arbitrary value. Some dialogs
+ // have very small widths for their contents views, which causes ugly
+ // title-wrapping where a two-word title is split across multiple lines or
+ // similar. To prevent that, forbid any snappable dialog from being narrower
+ // than this value.
Peter Kasting 2017/05/26 23:59:10 Nit: Dunno whether you want to say "we could try t
Elly Fong-Jones 2017/05/30 14:55:36 Done.
+ return min_width < 320 ? 320 : min_width;
Peter Kasting 2017/05/26 23:59:10 Nit: Simpler: return std::max(min_width, 320);
Elly Fong-Jones 2017/05/30 14:55:36 Done.
+}

Powered by Google App Engine
This is Rietveld 408576698