Chromium Code Reviews| Index: ui/views/controls/label.cc |
| diff --git a/ui/views/controls/label.cc b/ui/views/controls/label.cc |
| index 05322303bb6f85fef8affab9e3170459c0fbaa93..d82dead804858dc04d95d3dfe0ed31e667785857 100644 |
| --- a/ui/views/controls/label.cc |
| +++ b/ui/views/controls/label.cc |
| @@ -44,12 +44,19 @@ const int Label::kFocusBorderPadding = 1; |
| Label::Label() : Label(base::string16()) { |
| } |
| -Label::Label(const base::string16& text) : Label(text, GetDefaultFontList()) { |
| +Label::Label(const base::string16& text) |
| + : Label(text, |
| + typography::CONTEXT_CONTROL_LABEL, |
| + typography::STYLE_PRIMARY) {} |
| + |
| +Label::Label(const base::string16& text, int text_context, int text_style) |
| + : context_menu_contents_(this) { |
| + Init(text, typography::GetFont(text_context, text_style)); |
|
sky
2017/03/16 16:23:51
Is the plan to change other controls to call to Ge
Peter Kasting
2017/03/17 02:26:00
We probably should eventually... this is connected
tapted
2017/03/17 10:33:10
Yes! Everything should be using style::GetFont().
|
| } |
| -Label::Label(const base::string16& text, const gfx::FontList& font_list) |
| +Label::Label(const base::string16& text, const CustomFont& font) |
| : context_menu_contents_(this) { |
| - Init(text, font_list); |
| + Init(text, font.font_list); |
| } |
| Label::~Label() { |
| @@ -57,8 +64,8 @@ Label::~Label() { |
| // static |
| const gfx::FontList& Label::GetDefaultFontList() { |
| - ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| - return rb.GetFontListWithDelta(ui::kLabelFontSizeDelta); |
| + return typography::GetFont(typography::CONTEXT_CONTROL_LABEL, |
| + typography::STYLE_PRIMARY); |
| } |
| void Label::SetFontList(const gfx::FontList& font_list) { |