OLD | NEW |
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/harmony_layout_provider.h" | 5 #include "chrome/browser/ui/views/harmony/harmony_layout_provider.h" |
6 | 6 |
7 gfx::Insets HarmonyLayoutProvider::GetInsetsMetric(int metric) const { | 7 gfx::Insets HarmonyLayoutProvider::GetInsetsMetric(int metric) const { |
8 DCHECK_LT(metric, views::VIEWS_INSETS_MAX); | 8 DCHECK_LT(metric, views::VIEWS_INSETS_MAX); |
9 switch (metric) { | 9 switch (metric) { |
10 case views::INSETS_BUBBLE_CONTENTS: | 10 case views::INSETS_BUBBLE_CONTENTS: |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 case DISTANCE_SUBSECTION_HORIZONTAL_INDENT: | 64 case DISTANCE_SUBSECTION_HORIZONTAL_INDENT: |
65 return 0; | 65 return 0; |
66 case DISTANCE_UNRELATED_CONTROL_HORIZONTAL: | 66 case DISTANCE_UNRELATED_CONTROL_HORIZONTAL: |
67 return kHarmonyLayoutUnit; | 67 return kHarmonyLayoutUnit; |
68 case DISTANCE_UNRELATED_CONTROL_HORIZONTAL_LARGE: | 68 case DISTANCE_UNRELATED_CONTROL_HORIZONTAL_LARGE: |
69 return kHarmonyLayoutUnit; | 69 return kHarmonyLayoutUnit; |
70 case views::DISTANCE_UNRELATED_CONTROL_VERTICAL: | 70 case views::DISTANCE_UNRELATED_CONTROL_VERTICAL: |
71 return kHarmonyLayoutUnit; | 71 return kHarmonyLayoutUnit; |
72 case DISTANCE_UNRELATED_CONTROL_VERTICAL_LARGE: | 72 case DISTANCE_UNRELATED_CONTROL_VERTICAL_LARGE: |
73 return kHarmonyLayoutUnit; | 73 return kHarmonyLayoutUnit; |
| 74 default: |
| 75 return ChromeLayoutProvider::GetDistanceMetric(metric); |
74 } | 76 } |
75 NOTREACHED(); | |
76 return 0; | |
77 } | 77 } |
78 | 78 |
79 views::GridLayout::Alignment | 79 views::GridLayout::Alignment |
80 HarmonyLayoutProvider::GetControlLabelGridAlignment() const { | 80 HarmonyLayoutProvider::GetControlLabelGridAlignment() const { |
81 return views::GridLayout::LEADING; | 81 return views::GridLayout::LEADING; |
82 } | 82 } |
83 | 83 |
84 bool HarmonyLayoutProvider::UseExtraDialogPadding() const { | 84 bool HarmonyLayoutProvider::UseExtraDialogPadding() const { |
85 return false; | 85 return false; |
86 } | 86 } |
(...skipping 13 matching lines...) Expand all Loading... |
100 } | 100 } |
101 | 101 |
102 return ((min_width + kHarmonyLayoutUnit - 1) / kHarmonyLayoutUnit) * | 102 return ((min_width + kHarmonyLayoutUnit - 1) / kHarmonyLayoutUnit) * |
103 kHarmonyLayoutUnit; | 103 kHarmonyLayoutUnit; |
104 } | 104 } |
105 | 105 |
106 const views::TypographyProvider& HarmonyLayoutProvider::GetTypographyProvider() | 106 const views::TypographyProvider& HarmonyLayoutProvider::GetTypographyProvider() |
107 const { | 107 const { |
108 return typography_provider_; | 108 return typography_provider_; |
109 } | 109 } |
OLD | NEW |