| 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/chrome_typography.h" | 5 #include "chrome/browser/ui/views/harmony/chrome_typography.h" |
| 6 | 6 |
| 7 #include "ui/base/default_style.h" | 7 #include "ui/base/default_style.h" |
| 8 #include "ui/base/resource/resource_bundle.h" | 8 #include "ui/base/resource/resource_bundle.h" |
| 9 | 9 |
| 10 const gfx::FontList& LegacyTypographyProvider::GetFont(int text_context, | 10 const gfx::FontList& LegacyTypographyProvider::GetFont(int text_context, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 switch (text_style) { | 39 switch (text_style) { |
| 40 case STYLE_EMPHASIZED: | 40 case STYLE_EMPHASIZED: |
| 41 font_weight = gfx::Font::Weight::BOLD; | 41 font_weight = gfx::Font::Weight::BOLD; |
| 42 break; | 42 break; |
| 43 } | 43 } |
| 44 constexpr gfx::Font::FontStyle kFontStyle = gfx::Font::NORMAL; | 44 constexpr gfx::Font::FontStyle kFontStyle = gfx::Font::NORMAL; |
| 45 return ui::ResourceBundle::GetSharedInstance().GetFontListWithDelta( | 45 return ui::ResourceBundle::GetSharedInstance().GetFontListWithDelta( |
| 46 size_delta, kFontStyle, font_weight); | 46 size_delta, kFontStyle, font_weight); |
| 47 } | 47 } |
| 48 |
| 49 SkColor LegacyTypographyProvider::GetColor(int context, |
| 50 int style, |
| 51 const ui::NativeTheme& theme) const { |
| 52 // Use "disabled grey" for HINT and SECONDARY when Harmony is disabled. |
| 53 if (style == STYLE_HINT || style == STYLE_SECONDARY) |
| 54 style = views::style::STYLE_DISABLED; |
| 55 |
| 56 return DefaultTypographyProvider::GetColor(context, style, theme); |
| 57 } |
| OLD | NEW |