OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/views/style/typography.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "ui/views/style/typography_provider.h" |
| 9 #include "ui/views/views_delegate.h" |
| 10 |
| 11 namespace views { |
| 12 namespace style { |
| 13 namespace { |
| 14 |
| 15 void ValidateContextAndStyle(int text_context, int text_style) { |
| 16 DCHECK_GE(text_context, VIEWS_TEXT_CONTEXT_START); |
| 17 DCHECK_LT(text_context, TEXT_CONTEXT_MAX); |
| 18 DCHECK_GE(text_style, VIEWS_TEXT_STYLE_START); |
| 19 } |
| 20 |
| 21 } // namespace |
| 22 |
| 23 const gfx::FontList& GetFont(int text_context, int text_style) { |
| 24 ValidateContextAndStyle(text_context, text_style); |
| 25 return ViewsDelegate::GetInstance()->GetTypographyProvider().GetFont( |
| 26 text_context, text_style); |
| 27 } |
| 28 |
| 29 SkColor GetColor(int text_context, int text_style) { |
| 30 ValidateContextAndStyle(text_context, text_style); |
| 31 return ViewsDelegate::GetInstance()->GetTypographyProvider().GetColor( |
| 32 text_context, text_style); |
| 33 } |
| 34 |
| 35 int GetLineHeight(int text_context, int text_style) { |
| 36 ValidateContextAndStyle(text_context, text_style); |
| 37 return ViewsDelegate::GetInstance()->GetTypographyProvider().GetLineHeight( |
| 38 text_context, text_style); |
| 39 } |
| 40 |
| 41 } // namespace style |
| 42 } // namespace views |
OLD | NEW |