| 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_BUTTON_MD) { |
| 56 ui::NativeTheme::ColorId color_id = |
| 57 ui::NativeTheme::kColorId_ButtonEnabledColor; |
| 58 switch (style) { |
| 59 case views::style::STYLE_DIALOG_BUTTON_DEFAULT: |
| 60 color_id = ui::NativeTheme::kColorId_TextOnProminentButtonColor; |
| 61 break; |
| 62 case views::style::STYLE_DISABLED: |
| 63 color_id = ui::NativeTheme::kColorId_ButtonDisabledColor; |
| 64 break; |
| 65 } |
| 66 return theme.GetSystemColor(color_id); |
| 67 } |
| 68 |
| 55 return theme.GetSystemColor( | 69 return theme.GetSystemColor( |
| 56 (style == style::STYLE_DISABLED) | 70 (style == style::STYLE_DISABLED) |
| 57 ? ui::NativeTheme::kColorId_LabelDisabledColor | 71 ? ui::NativeTheme::kColorId_LabelDisabledColor |
| 58 : ui::NativeTheme::kColorId_LabelEnabledColor); | 72 : ui::NativeTheme::kColorId_LabelEnabledColor); |
| 59 } | 73 } |
| 60 | 74 |
| 61 int DefaultTypographyProvider::GetLineHeight(int context, int style) const { | 75 int DefaultTypographyProvider::GetLineHeight(int context, int style) const { |
| 62 return 0; | 76 return 0; |
| 63 } | 77 } |
| 64 | 78 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 95 *font_weight = GetValueBolderThan( | 109 *font_weight = GetValueBolderThan( |
| 96 ResourceBundle::GetSharedInstance() | 110 ResourceBundle::GetSharedInstance() |
| 97 .GetFontListWithDelta(*size_delta, Font::NORMAL, *font_weight) | 111 .GetFontListWithDelta(*size_delta, Font::NORMAL, *font_weight) |
| 98 .GetFontWeight()); | 112 .GetFontWeight()); |
| 99 } | 113 } |
| 100 break; | 114 break; |
| 101 } | 115 } |
| 102 } | 116 } |
| 103 | 117 |
| 104 } // namespace views | 118 } // namespace views |
| OLD | NEW |