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

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: 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') | Source/platform/fonts/FontCache.h » ('J')
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..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:
« no previous file with comments | « no previous file | Source/platform/fonts/FontCache.h » ('j') | Source/platform/fonts/FontCache.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698