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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" 5 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "chrome/browser/ui/views/harmony/chrome_typography.h" 9 #include "chrome/browser/ui/views/harmony/chrome_typography.h"
10 #include "chrome/browser/ui/views/harmony/harmony_layout_provider.h" 10 #include "chrome/browser/ui/views/harmony/harmony_layout_provider.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 return true; 70 return true;
71 } 71 }
72 72
73 bool ChromeLayoutProvider::ShouldShowWindowIcon() const { 73 bool ChromeLayoutProvider::ShouldShowWindowIcon() const {
74 return true; 74 return true;
75 } 75 }
76 76
77 bool ChromeLayoutProvider::IsHarmonyMode() const { 77 bool ChromeLayoutProvider::IsHarmonyMode() const {
78 return false; 78 return false;
79 } 79 }
80
81 int ChromeLayoutProvider::GetSnappedDialogWidth(int min_width) const {
82 // This is an arbitrary value, but it's a good arbitrary value. Some dialogs
83 // have very small widths for their contents views, which causes ugly
84 // title-wrapping where a two-word title is split across multiple lines or
85 // similar. To prevent that, forbid any snappable dialog from being narrower
86 // 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.
87 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.
88 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698