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

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

Issue 2860953002: Harmony: Apply the upper bound on equal-sized button widths in DialogClientView. (Closed)
Patch Set: test_layout_provider.h, sanity checks, self-review: nit data member names 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
« no previous file with comments | « ui/views/layout/layout_provider.h ('k') | ui/views/test/test_layout_provider.h » ('j') | 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 case InsetsMetric::INSETS_VECTOR_IMAGE_BUTTON: 49 case InsetsMetric::INSETS_VECTOR_IMAGE_BUTTON:
50 return gfx::Insets(kVectorButtonExtraTouchSize); 50 return gfx::Insets(kVectorButtonExtraTouchSize);
51 } 51 }
52 NOTREACHED(); 52 NOTREACHED();
53 return gfx::Insets(); 53 return gfx::Insets();
54 } 54 }
55 55
56 int LayoutProvider::GetDistanceMetric(int metric) const { 56 int LayoutProvider::GetDistanceMetric(int metric) const {
57 DCHECK_GE(metric, VIEWS_INSETS_MAX); 57 DCHECK_GE(metric, VIEWS_INSETS_MAX);
58 switch (metric) { 58 switch (metric) {
59 case DistanceMetric::DISTANCE_BUTTON_HORIZONTAL_PADDING:
60 return kButtonHorizontalPadding;
61 case DistanceMetric::DISTANCE_BUTTON_MAX_LINKABLE_WIDTH:
62 return 0;
59 case DistanceMetric::DISTANCE_CLOSE_BUTTON_MARGIN: 63 case DistanceMetric::DISTANCE_CLOSE_BUTTON_MARGIN:
60 return kCloseButtonMargin; 64 return kCloseButtonMargin;
61 case DistanceMetric::DISTANCE_RELATED_BUTTON_HORIZONTAL: 65 case DistanceMetric::DISTANCE_RELATED_BUTTON_HORIZONTAL:
62 return kRelatedButtonHSpacing; 66 return kRelatedButtonHSpacing;
63 case DistanceMetric::DISTANCE_RELATED_CONTROL_HORIZONTAL: 67 case DistanceMetric::DISTANCE_RELATED_CONTROL_HORIZONTAL:
64 return kRelatedControlHorizontalSpacing; 68 return kRelatedControlHorizontalSpacing;
65 case DistanceMetric::DISTANCE_RELATED_CONTROL_VERTICAL: 69 case DistanceMetric::DISTANCE_RELATED_CONTROL_VERTICAL:
66 return kRelatedControlVerticalSpacing; 70 return kRelatedControlVerticalSpacing;
67 case DistanceMetric::DISTANCE_DIALOG_BUTTON_MINIMUM_WIDTH: 71 case DistanceMetric::DISTANCE_DIALOG_BUTTON_MINIMUM_WIDTH:
68 return kDialogMinimumButtonWidth; 72 return kDialogMinimumButtonWidth;
69 case DistanceMetric::DISTANCE_BUTTON_HORIZONTAL_PADDING:
70 return kButtonHorizontalPadding;
71 } 73 }
72 NOTREACHED(); 74 NOTREACHED();
73 return 0; 75 return 0;
74 } 76 }
75 77
76 const TypographyProvider& LayoutProvider::GetTypographyProvider() const { 78 const TypographyProvider& LayoutProvider::GetTypographyProvider() const {
77 return typography_provider_; 79 return typography_provider_;
78 } 80 }
79 81
80 int LayoutProvider::GetSnappedDialogWidth(int min_width) const { 82 int LayoutProvider::GetSnappedDialogWidth(int min_width) const {
81 return min_width; 83 return min_width;
82 } 84 }
83 85
84 } // namespace views 86 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/layout/layout_provider.h ('k') | ui/views/test/test_layout_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698