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

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

Issue 2934503002: Remove references to ui/views/layout/layout_constants.h (Closed)
Patch Set: 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 | « ui/views/layout/layout_provider.h ('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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 case DistanceMetric::DISTANCE_RELATED_CONTROL_HORIZONTAL: 87 case DistanceMetric::DISTANCE_RELATED_CONTROL_HORIZONTAL:
88 return kRelatedControlHorizontalSpacing; 88 return kRelatedControlHorizontalSpacing;
89 case DistanceMetric::DISTANCE_RELATED_CONTROL_VERTICAL: 89 case DistanceMetric::DISTANCE_RELATED_CONTROL_VERTICAL:
90 return kRelatedControlVerticalSpacing; 90 return kRelatedControlVerticalSpacing;
91 case DISTANCE_DIALOG_BUTTON_BOTTOM_MARGIN: 91 case DISTANCE_DIALOG_BUTTON_BOTTOM_MARGIN:
92 return views::kButtonVEdgeMarginNew; 92 return views::kButtonVEdgeMarginNew;
93 case DistanceMetric::DISTANCE_DIALOG_BUTTON_MINIMUM_WIDTH: 93 case DistanceMetric::DISTANCE_DIALOG_BUTTON_MINIMUM_WIDTH:
94 return kDialogMinimumButtonWidth; 94 return kDialogMinimumButtonWidth;
95 case DISTANCE_DIALOG_CONTENTS_HORIZONTAL_MARGIN: 95 case DISTANCE_DIALOG_CONTENTS_HORIZONTAL_MARGIN:
96 return kButtonHEdgeMarginNew; 96 return kButtonHEdgeMarginNew;
97 case DISTANCE_UNRELATED_CONTROL_VERTICAL:
98 return kUnrelatedControlVerticalSpacing;
97 } 99 }
98 NOTREACHED(); 100 NOTREACHED();
99 return 0; 101 return 0;
100 } 102 }
101 103
102 const TypographyProvider& LayoutProvider::GetTypographyProvider() const { 104 const TypographyProvider& LayoutProvider::GetTypographyProvider() const {
103 return typography_provider_; 105 return typography_provider_;
104 } 106 }
105 107
106 int LayoutProvider::GetSnappedDialogWidth(int min_width) const { 108 int LayoutProvider::GetSnappedDialogWidth(int min_width) const {
107 // This is an arbitrary value, but it's a good arbitrary value. Some dialogs 109 // 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 110 // 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 111 // 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 112 // 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 113 // than this value. In principle it's possible to factor in the title width
112 // here, but it is not really worth the complexity. 114 // here, but it is not really worth the complexity.
113 return std::max(min_width, 320); 115 return std::max(min_width, 320);
114 } 116 }
115 117
116 } // namespace views 118 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/layout/layout_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698