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

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

Issue 2758323002: Broke out layout metric information from ViewsDelegate to LayoutProvider (Closed)
Patch Set: Final feedback addressed Created 3 years, 8 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
« no previous file with comments | « ui/views/mus/aura_init.cc ('k') | ui/views/test/scoped_views_test_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ui/views/style/typography.h" 5 #include "ui/views/style/typography.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/views/layout/layout_provider.h"
8 #include "ui/views/style/typography_provider.h" 9 #include "ui/views/style/typography_provider.h"
9 #include "ui/views/views_delegate.h"
10 10
11 namespace views { 11 namespace views {
12 namespace style { 12 namespace style {
13 namespace { 13 namespace {
14 14
15 void ValidateContextAndStyle(int text_context, int text_style) { 15 void ValidateContextAndStyle(int text_context, int text_style) {
16 DCHECK_GE(text_context, VIEWS_TEXT_CONTEXT_START); 16 DCHECK_GE(text_context, VIEWS_TEXT_CONTEXT_START);
17 DCHECK_LT(text_context, TEXT_CONTEXT_MAX); 17 DCHECK_LT(text_context, TEXT_CONTEXT_MAX);
18 DCHECK_GE(text_style, VIEWS_TEXT_STYLE_START); 18 DCHECK_GE(text_style, VIEWS_TEXT_STYLE_START);
19 } 19 }
20 20
21 } // namespace 21 } // namespace
22 22
23 const gfx::FontList& GetFont(int text_context, int text_style) { 23 const gfx::FontList& GetFont(int text_context, int text_style) {
24 ValidateContextAndStyle(text_context, text_style); 24 ValidateContextAndStyle(text_context, text_style);
25 return ViewsDelegate::GetInstance()->GetTypographyProvider().GetFont( 25 return LayoutProvider::Get()->GetTypographyProvider().GetFont(text_context,
26 text_context, text_style); 26 text_style);
27 } 27 }
28 28
29 SkColor GetColor(int text_context, int text_style) { 29 SkColor GetColor(int text_context, int text_style) {
30 ValidateContextAndStyle(text_context, text_style); 30 ValidateContextAndStyle(text_context, text_style);
31 return ViewsDelegate::GetInstance()->GetTypographyProvider().GetColor( 31 return LayoutProvider::Get()->GetTypographyProvider().GetColor(text_context,
32 text_context, text_style); 32 text_style);
33 } 33 }
34 34
35 int GetLineHeight(int text_context, int text_style) { 35 int GetLineHeight(int text_context, int text_style) {
36 ValidateContextAndStyle(text_context, text_style); 36 ValidateContextAndStyle(text_context, text_style);
37 return ViewsDelegate::GetInstance()->GetTypographyProvider().GetLineHeight( 37 return LayoutProvider::Get()->GetTypographyProvider().GetLineHeight(
38 text_context, text_style); 38 text_context, text_style);
39 } 39 }
40 40
41 } // namespace style 41 } // namespace style
42 } // namespace views 42 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/mus/aura_init.cc ('k') | ui/views/test/scoped_views_test_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698