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

Unified Diff: Source/core/rendering/RenderThemeChromiumFontProviderWin.cpp

Issue 790733005: Blink side of the change to pass the system font metrics from the browser to the renderer on Windo… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address review comments Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/platform/fonts/FontCache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderThemeChromiumFontProviderWin.cpp
diff --git a/Source/core/rendering/RenderThemeChromiumFontProviderWin.cpp b/Source/core/rendering/RenderThemeChromiumFontProviderWin.cpp
index a27d62f4d355ae42045d7113f10631c49658b9ae..18a6ca7b6d548ae04e86182da3816453fcca95cc 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 = FontCache::smallCaptionFontFamily();
+ } 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 = 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 = FontCache::statusFontFamily();
+ } else {
+ NONCLIENTMETRICS metrics;
+ getNonClientMetrics(&metrics);
+ fontSize = systemFontSize(metrics.lfStatusFont);
+ fontFamily = metrics.lfStatusFont.lfFaceName;
+ }
break;
}
case CSSValueWebkitMiniControl:
« no previous file with comments | « no previous file | Source/platform/fonts/FontCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698