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_typography_provider.h" | 5 #include "chrome/browser/ui/views/harmony/harmony_typography_provider.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "chrome/browser/ui/views/harmony/chrome_typography.h" | 8 #include "chrome/browser/ui/views/harmony/chrome_typography.h" |
9 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
10 #include "ui/gfx/color_palette.h" | 10 #include "ui/gfx/color_palette.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 constexpr int kBodyTextLargeSize = 13; | 89 constexpr int kBodyTextLargeSize = 13; |
90 constexpr int kDefaultSize = 12; | 90 constexpr int kDefaultSize = 12; |
91 | 91 |
92 int size_delta = kDefaultSize - gfx::PlatformFont::kDefaultBaseFontSize; | 92 int size_delta = kDefaultSize - gfx::PlatformFont::kDefaultBaseFontSize; |
93 gfx::Font::Weight font_weight = gfx::Font::Weight::NORMAL; | 93 gfx::Font::Weight font_weight = gfx::Font::Weight::NORMAL; |
94 | 94 |
95 #if defined(USE_ASH) | 95 #if defined(USE_ASH) |
96 ash::ApplyAshFontStyles(context, style, &size_delta, &font_weight); | 96 ash::ApplyAshFontStyles(context, style, &size_delta, &font_weight); |
97 #endif | 97 #endif |
98 | 98 |
| 99 ApplyCommonFontStyles(context, style, &size_delta, &font_weight); |
| 100 |
99 switch (context) { | 101 switch (context) { |
100 case views::style::CONTEXT_BUTTON_MD: | 102 case views::style::CONTEXT_BUTTON_MD: |
101 font_weight = MediumWeightForUI(); | 103 font_weight = MediumWeightForUI(); |
102 break; | 104 break; |
103 case views::style::CONTEXT_DIALOG_TITLE: | 105 case views::style::CONTEXT_DIALOG_TITLE: |
104 size_delta = kTitleSize - gfx::PlatformFont::kDefaultBaseFontSize; | 106 size_delta = kTitleSize - gfx::PlatformFont::kDefaultBaseFontSize; |
105 break; | 107 break; |
106 case CONTEXT_BODY_TEXT_LARGE: | 108 case CONTEXT_BODY_TEXT_LARGE: |
107 size_delta = kBodyTextLargeSize - gfx::PlatformFont::kDefaultBaseFontSize; | 109 size_delta = kBodyTextLargeSize - gfx::PlatformFont::kDefaultBaseFontSize; |
108 break; | 110 break; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 case views::style::CONTEXT_DIALOG_TITLE: | 217 case views::style::CONTEXT_DIALOG_TITLE: |
216 return title_height; | 218 return title_height; |
217 case CONTEXT_BODY_TEXT_LARGE: | 219 case CONTEXT_BODY_TEXT_LARGE: |
218 return body_large_height; | 220 return body_large_height; |
219 case CONTEXT_HEADLINE: | 221 case CONTEXT_HEADLINE: |
220 return headline_height; | 222 return headline_height; |
221 default: | 223 default: |
222 return default_height; | 224 return default_height; |
223 } | 225 } |
224 } | 226 } |
OLD | NEW |