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

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

Issue 16415007: Cleanup usage of CSSPropertyID and CSSValueID inside Blink. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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 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 23 matching lines...) Expand all
34 34
35 namespace WebCore { 35 namespace WebCore {
36 36
37 // static 37 // static
38 void RenderThemeChromiumFontProvider::setDefaultFontSize(int fontSize) 38 void RenderThemeChromiumFontProvider::setDefaultFontSize(int fontSize)
39 { 39 {
40 s_defaultFontSize = static_cast<float>(fontSize); 40 s_defaultFontSize = static_cast<float>(fontSize);
41 } 41 }
42 42
43 // static 43 // static
44 void RenderThemeChromiumFontProvider::systemFont(int propId, FontDescription& fo ntDescription) 44 void RenderThemeChromiumFontProvider::systemFont(CSSValueID valueID, FontDescrip tion& fontDescription)
45 { 45 {
46 float fontSize = s_defaultFontSize; 46 float fontSize = s_defaultFontSize;
47 47
48 switch (propId) { 48 switch (valueID) {
49 case CSSValueWebkitMiniControl: 49 case CSSValueWebkitMiniControl:
50 case CSSValueWebkitSmallControl: 50 case CSSValueWebkitSmallControl:
51 case CSSValueWebkitControl: 51 case CSSValueWebkitControl:
52 // Why 2 points smaller? Because that's what Gecko does. Note that we 52 // Why 2 points smaller? Because that's what Gecko does. Note that we
53 // are assuming a 96dpi screen, which is the default that we use on 53 // are assuming a 96dpi screen, which is the default that we use on
54 // Windows. 54 // Windows.
55 static const float pointsPerInch = 72.0f; 55 static const float pointsPerInch = 72.0f;
56 static const float pixelsPerInch = 96.0f; 56 static const float pixelsPerInch = 96.0f;
57 fontSize -= (2.0f / pointsPerInch) * pixelsPerInch; 57 fontSize -= (2.0f / pointsPerInch) * pixelsPerInch;
58 break; 58 break;
59 default:
60 break;
59 } 61 }
60 62
61 fontDescription.firstFamily().setFamily(defaultGUIFont()); 63 fontDescription.firstFamily().setFamily(defaultGUIFont());
62 fontDescription.setSpecifiedSize(fontSize); 64 fontDescription.setSpecifiedSize(fontSize);
63 fontDescription.setIsAbsoluteSize(true); 65 fontDescription.setIsAbsoluteSize(true);
64 fontDescription.setGenericFamily(FontDescription::NoFamily); 66 fontDescription.setGenericFamily(FontDescription::NoFamily);
65 fontDescription.setWeight(FontWeightNormal); 67 fontDescription.setWeight(FontWeightNormal);
66 fontDescription.setItalic(false); 68 fontDescription.setItalic(false);
67 } 69 }
68 70
69 } // namespace WebCore 71 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderThemeChromiumFontProvider.h ('k') | Source/core/rendering/RenderThemeChromiumFontProviderWin.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698