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_DIALOG_BUTTON: | 10 case views::INSETS_DIALOG_BUTTON: |
11 case views::INSETS_PANEL: | 11 case views::INSETS_PANEL: |
12 case views::INSETS_BUBBLE_CONTENTS: | 12 case views::INSETS_BUBBLE_CONTENTS: |
13 return gfx::Insets(kHarmonyLayoutUnit); | 13 return gfx::Insets(kHarmonyLayoutUnit); |
| 14 case views::INSETS_BUBBLE_TITLE: |
14 case views::INSETS_DIALOG_TITLE: { | 15 case views::INSETS_DIALOG_TITLE: { |
15 constexpr int top = kHarmonyLayoutUnit; | 16 constexpr int top = kHarmonyLayoutUnit; |
16 constexpr int side = kHarmonyLayoutUnit; | 17 constexpr int side = kHarmonyLayoutUnit; |
17 // Titles are inset at the top and sides, but not at the bottom. | 18 // Titles are inset at the top and sides, but not at the bottom. |
18 return gfx::Insets(top, side, 0, side); | 19 return gfx::Insets(top, side, 0, side); |
19 } | 20 } |
20 case views::INSETS_VECTOR_IMAGE_BUTTON: | 21 case views::INSETS_VECTOR_IMAGE_BUTTON: |
21 return gfx::Insets(kHarmonyLayoutUnit / 4); | 22 return gfx::Insets(kHarmonyLayoutUnit / 4); |
22 } | 23 } |
23 NOTREACHED(); | 24 NOTREACHED(); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 return 512; | 105 return 512; |
105 } | 106 } |
106 NOTREACHED(); | 107 NOTREACHED(); |
107 return 0; | 108 return 0; |
108 } | 109 } |
109 | 110 |
110 const views::TypographyProvider& HarmonyLayoutProvider::GetTypographyProvider() | 111 const views::TypographyProvider& HarmonyLayoutProvider::GetTypographyProvider() |
111 const { | 112 const { |
112 return typography_provider_; | 113 return typography_provider_; |
113 } | 114 } |
OLD | NEW |