OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/harmony_layout_delegate.h" | 5 #include "chrome/browser/ui/views/harmony/harmony_layout_delegate.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 | 9 |
10 static base::LazyInstance<HarmonyLayoutDelegate> harmony_layout_delegate_ = | 10 static base::LazyInstance<HarmonyLayoutDelegate> harmony_layout_delegate_ = |
(...skipping 14 matching lines...) Expand all Loading... |
25 case Metric::DIALOG_BUTTON_MINIMUM_WIDTH: | 25 case Metric::DIALOG_BUTTON_MINIMUM_WIDTH: |
26 // Minimum label size plus padding. | 26 // Minimum label size plus padding. |
27 return 2 * kHarmonyLayoutUnit + | 27 return 2 * kHarmonyLayoutUnit + |
28 2 * GetMetric(Metric::BUTTON_HORIZONTAL_PADDING); | 28 2 * GetMetric(Metric::BUTTON_HORIZONTAL_PADDING); |
29 case Metric::DIALOG_BUTTON_TOP_SPACING: | 29 case Metric::DIALOG_BUTTON_TOP_SPACING: |
30 return kHarmonyLayoutUnit; | 30 return kHarmonyLayoutUnit; |
31 case Metric::DIALOG_CLOSE_BUTTON_MARGIN: | 31 case Metric::DIALOG_CLOSE_BUTTON_MARGIN: |
32 // TODO(pkasting): The "- 4" here is a hack that matches the extra padding | 32 // TODO(pkasting): The "- 4" here is a hack that matches the extra padding |
33 // in vector_icon_button.cc and should be removed when that padding is. | 33 // in vector_icon_button.cc and should be removed when that padding is. |
34 return (kHarmonyLayoutUnit / 2) - 4; | 34 return (kHarmonyLayoutUnit / 2) - 4; |
| 35 case Metric::ICON_TEXT_SPACING: |
| 36 return kHarmonyLayoutUnit; |
35 case Metric::PANEL_CONTENT_MARGIN: | 37 case Metric::PANEL_CONTENT_MARGIN: |
36 return kHarmonyLayoutUnit; | 38 return kHarmonyLayoutUnit; |
37 case Metric::RELATED_BUTTON_HORIZONTAL_SPACING: | 39 case Metric::RELATED_BUTTON_HORIZONTAL_SPACING: |
38 return kHarmonyLayoutUnit / 2; | 40 return kHarmonyLayoutUnit / 2; |
39 case Metric::RELATED_CONTROL_HORIZONTAL_SPACING: | 41 case Metric::RELATED_CONTROL_HORIZONTAL_SPACING: |
40 return kHarmonyLayoutUnit; | 42 return kHarmonyLayoutUnit; |
41 case Metric::RELATED_CONTROL_VERTICAL_SPACING: | 43 case Metric::RELATED_CONTROL_VERTICAL_SPACING: |
42 return kHarmonyLayoutUnit / 2; | 44 return kHarmonyLayoutUnit / 2; |
43 case Metric::RELATED_LABEL_HORIZONTAL_SPACING: | 45 case Metric::RELATED_LABEL_HORIZONTAL_SPACING: |
44 return kHarmonyLayoutUnit; | 46 return kHarmonyLayoutUnit; |
(...skipping 30 matching lines...) Expand all Loading... |
75 case DialogWidth::SMALL: | 77 case DialogWidth::SMALL: |
76 return 320; | 78 return 320; |
77 case DialogWidth::MEDIUM: | 79 case DialogWidth::MEDIUM: |
78 return 448; | 80 return 448; |
79 case DialogWidth::LARGE: | 81 case DialogWidth::LARGE: |
80 return 512; | 82 return 512; |
81 } | 83 } |
82 NOTREACHED(); | 84 NOTREACHED(); |
83 return 0; | 85 return 0; |
84 } | 86 } |
OLD | NEW |