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

Side by Side Diff: ui/views/layout/layout_provider.cc

Issue 2907873002: views: impose minimum width on non-Harmony snappables (Closed)
Patch Set: move into ui/views Created 3 years, 6 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
« no previous file with comments | « chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/views/layout/layout_provider.h" 5 #include "ui/views/layout/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 "ui/base/material_design/material_design_controller.h" 9 #include "ui/base/material_design/material_design_controller.h"
10 #include "ui/views/layout/layout_constants.h" 10 #include "ui/views/layout/layout_constants.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } 97 }
98 NOTREACHED(); 98 NOTREACHED();
99 return 0; 99 return 0;
100 } 100 }
101 101
102 const TypographyProvider& LayoutProvider::GetTypographyProvider() const { 102 const TypographyProvider& LayoutProvider::GetTypographyProvider() const {
103 return typography_provider_; 103 return typography_provider_;
104 } 104 }
105 105
106 int LayoutProvider::GetSnappedDialogWidth(int min_width) const { 106 int LayoutProvider::GetSnappedDialogWidth(int min_width) const {
107 return min_width; 107 // This is an arbitrary value, but it's a good arbitrary value. Some dialogs
108 // have very small widths for their contents views, which causes ugly
109 // title-wrapping where a two-word title is split across multiple lines or
110 // similar. To prevent that, forbid any snappable dialog from being narrower
111 // than this value. In principle it's possible to factor in the title width
112 // here, but it is not really worth the complexity.
113 return std::max(min_width, 320);
108 } 114 }
109 115
110 } // namespace views 116 } // namespace views
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698