| 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 "ui/views/style/typography_provider.h" | 5 #include "ui/views/style/typography_provider.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ui/base/default_style.h" | 8 #include "ui/base/default_style.h" |
| 9 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
| 10 #include "ui/native_theme/native_theme.h" | 10 #include "ui/native_theme/native_theme.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 Font::Weight font_weight; | 45 Font::Weight font_weight; |
| 46 GetDefaultFont(context, style, &size_delta, &font_weight); | 46 GetDefaultFont(context, style, &size_delta, &font_weight); |
| 47 return ResourceBundle::GetSharedInstance().GetFontListWithDelta( | 47 return ResourceBundle::GetSharedInstance().GetFontListWithDelta( |
| 48 size_delta, Font::NORMAL, font_weight); | 48 size_delta, Font::NORMAL, font_weight); |
| 49 } | 49 } |
| 50 | 50 |
| 51 SkColor DefaultTypographyProvider::GetColor( | 51 SkColor DefaultTypographyProvider::GetColor( |
| 52 int context, | 52 int context, |
| 53 int style, | 53 int style, |
| 54 const ui::NativeTheme& theme) const { | 54 const ui::NativeTheme& theme) const { |
| 55 if (context == style::CONTEXT_TEXTFIELD) { |
| 56 return theme.GetSystemColor( |
| 57 style == style::STYLE_DISABLED |
| 58 ? ui::NativeTheme::kColorId_TextfieldReadOnlyColor |
| 59 : ui::NativeTheme::kColorId_TextfieldDefaultColor); |
| 60 } |
| 61 |
| 55 return theme.GetSystemColor( | 62 return theme.GetSystemColor( |
| 56 (style == style::STYLE_DISABLED) | 63 (style == style::STYLE_DISABLED) |
| 57 ? ui::NativeTheme::kColorId_LabelDisabledColor | 64 ? ui::NativeTheme::kColorId_LabelDisabledColor |
| 58 : ui::NativeTheme::kColorId_LabelEnabledColor); | 65 : ui::NativeTheme::kColorId_LabelEnabledColor); |
| 59 } | 66 } |
| 60 | 67 |
| 61 int DefaultTypographyProvider::GetLineHeight(int context, int style) const { | 68 int DefaultTypographyProvider::GetLineHeight(int context, int style) const { |
| 62 return 0; | 69 return 0; |
| 63 } | 70 } |
| 64 | 71 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 95 *font_weight = GetValueBolderThan( | 102 *font_weight = GetValueBolderThan( |
| 96 ResourceBundle::GetSharedInstance() | 103 ResourceBundle::GetSharedInstance() |
| 97 .GetFontListWithDelta(*size_delta, Font::NORMAL, *font_weight) | 104 .GetFontListWithDelta(*size_delta, Font::NORMAL, *font_weight) |
| 98 .GetFontWeight()); | 105 .GetFontWeight()); |
| 99 } | 106 } |
| 100 break; | 107 break; |
| 101 } | 108 } |
| 102 } | 109 } |
| 103 | 110 |
| 104 } // namespace views | 111 } // namespace views |
| OLD | NEW |