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

Side by Side Diff: Source/core/rendering/RenderThemeChromiumFontProviderWin.cpp

Issue 39693002: Introduce isWindowsVistaOrGreater() as replacement of windowsVersion() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 2013-10-28T12:54:24 Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 else 71 else
72 pixelsPerInch = 96.0f; 72 pixelsPerInch = 96.0f;
73 } 73 }
74 74
75 static const float pointsPerInch = 72.0f; 75 static const float pointsPerInch = 72.0f;
76 return points / pointsPerInch * pixelsPerInch; 76 return points / pointsPerInch * pixelsPerInch;
77 } 77 }
78 78
79 static void getNonClientMetrics(NONCLIENTMETRICS* metrics) 79 static void getNonClientMetrics(NONCLIENTMETRICS* metrics)
80 { 80 {
81 static UINT size = (windowsVersion() >= WindowsVista) ? 81 static UINT size = isWindowsVistaOrGreater() ?
82 sizeof(NONCLIENTMETRICS) : NONCLIENTMETRICS_SIZE_PRE_VISTA; 82 sizeof(NONCLIENTMETRICS) : NONCLIENTMETRICS_SIZE_PRE_VISTA;
83 metrics->cbSize = size; 83 metrics->cbSize = size;
84 bool success = !!SystemParametersInfo(SPI_GETNONCLIENTMETRICS, size, metrics , 0); 84 bool success = !!SystemParametersInfo(SPI_GETNONCLIENTMETRICS, size, metrics , 0);
85 ASSERT(success); 85 ASSERT(success);
86 } 86 }
87 87
88 // Return the height of system font |font| in pixels. We use this size by 88 // Return the height of system font |font| in pixels. We use this size by
89 // default for some non-form-control elements. 89 // default for some non-form-control elements.
90 static float systemFontSize(const LOGFONT& font) 90 static float systemFontSize(const LOGFONT& font)
91 { 91 {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 // static 183 // static
184 void RenderThemeChromiumFontProvider::setDefaultFontSize(int fontSize) 184 void RenderThemeChromiumFontProvider::setDefaultFontSize(int fontSize)
185 { 185 {
186 s_defaultFontSize = static_cast<float>(fontSize); 186 s_defaultFontSize = static_cast<float>(fontSize);
187 187
188 // Reset cached fonts. 188 // Reset cached fonts.
189 smallSystemFont() = menuFont() = labelFont() = FontDescription(); 189 smallSystemFont() = menuFont() = labelFont() = FontDescription();
190 } 190 }
191 191
192 } // namespace WebCore 192 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp ('k') | Source/platform/win/SystemInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698