Chromium Code Reviews| Index: Source/core/rendering/RenderThemeChromiumFontProviderWin.cpp |
| diff --git a/Source/core/rendering/RenderThemeChromiumFontProviderWin.cpp b/Source/core/rendering/RenderThemeChromiumFontProviderWin.cpp |
| index a27d62f4d355ae42045d7113f10631c49658b9ae..1d123b2b7eead2fc06a0062faf485327cba1f58b 100644 |
| --- a/Source/core/rendering/RenderThemeChromiumFontProviderWin.cpp |
| +++ b/Source/core/rendering/RenderThemeChromiumFontProviderWin.cpp |
| @@ -27,6 +27,7 @@ |
| #include "core/rendering/RenderThemeChromiumFontProvider.h" |
| #include "core/CSSValueKeywords.h" |
| +#include "platform/fonts/FontCache.h" |
| #include "platform/fonts/FontDescription.h" |
| #include "platform/win/HWndDC.h" |
| #include "platform/win/SystemInfo.h" |
| @@ -107,24 +108,39 @@ void RenderThemeChromiumFontProvider::systemFont(CSSValueID systemFontID, FontSt |
| switch (systemFontID) { |
| case CSSValueSmallCaption: { |
| - NONCLIENTMETRICS metrics; |
| - getNonClientMetrics(&metrics); |
| - fontSize = systemFontSize(metrics.lfSmCaptionFont); |
| - fontFamily = AtomicString(metrics.lfSmCaptionFont.lfFaceName, wcslen(metrics.lfSmCaptionFont.lfFaceName)); |
| + fontSize = FontCache::smallCaptionFontHeight(); |
| + if (fontSize) { |
| + fontFamily = AtomicString(FontCache::smallCaptionFontFamily()); |
|
scottmg
2015/01/06 23:15:23
Since they're only used as AtomicString, maybe sto
|
| + } else { |
| + NONCLIENTMETRICS metrics; |
| + getNonClientMetrics(&metrics); |
| + fontSize = systemFontSize(metrics.lfSmCaptionFont); |
| + fontFamily = AtomicString(metrics.lfSmCaptionFont.lfFaceName, wcslen(metrics.lfSmCaptionFont.lfFaceName)); |
| + } |
| break; |
| } |
| case CSSValueMenu: { |
| - NONCLIENTMETRICS metrics; |
| - getNonClientMetrics(&metrics); |
| - fontSize = systemFontSize(metrics.lfMenuFont); |
| - fontFamily = AtomicString(metrics.lfMenuFont.lfFaceName, wcslen(metrics.lfMenuFont.lfFaceName)); |
| + fontSize = FontCache::menuFontHeight(); |
| + if (fontSize) { |
| + fontFamily = AtomicString(FontCache::menuFontFamily()); |
| + } else { |
| + NONCLIENTMETRICS metrics; |
| + getNonClientMetrics(&metrics); |
| + fontSize = systemFontSize(metrics.lfMenuFont); |
| + fontFamily = AtomicString(metrics.lfMenuFont.lfFaceName, wcslen(metrics.lfMenuFont.lfFaceName)); |
| + } |
| break; |
| } |
| case CSSValueStatusBar: { |
| - NONCLIENTMETRICS metrics; |
| - getNonClientMetrics(&metrics); |
| - fontSize = systemFontSize(metrics.lfStatusFont); |
| - fontFamily = metrics.lfStatusFont.lfFaceName; |
| + fontSize = FontCache::statusFontHeight(); |
| + if (fontSize) { |
| + fontFamily = AtomicString(FontCache::statusFontFamily()); |
| + } else { |
| + NONCLIENTMETRICS metrics; |
| + getNonClientMetrics(&metrics); |
| + fontSize = systemFontSize(metrics.lfStatusFont); |
| + fontFamily = metrics.lfStatusFont.lfFaceName; |
| + } |
| break; |
| } |
| case CSSValueWebkitMiniControl: |