Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: ui/views/style/typography.cc

Issue 2734113006: "Bootstrap" a toolkit-views Typography spec. (Closed)
Patch Set: Rebase (conflict in layout_delegate.h due to r457774) Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698