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

Unified Diff: webkit/glue/webpreferences.cc

Issue 10107014: Migrate WebKit "global script" font prefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 8 years, 7 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
Index: webkit/glue/webpreferences.cc
diff --git a/webkit/glue/webpreferences.cc b/webkit/glue/webpreferences.cc
index 359e0b0c7fa2935e535a9e9a283e7e4b2373ada8..40d15aa94cec9e445edeb4a1a23d8fa2f6b13c27 100644
--- a/webkit/glue/webpreferences.cc
+++ b/webkit/glue/webpreferences.cc
@@ -4,8 +4,6 @@
#include "webkit/glue/webpreferences.h"
-#include <unicode/uchar.h>
-
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h"
@@ -16,6 +14,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
+#include "unicode/uchar.h"
#include "webkit/glue/webkit_glue.h"
using WebKit::WebNetworkStateNotifier;
@@ -27,14 +26,11 @@ using WebKit::WebView;
namespace webkit_glue {
+// "Zyyy" is the ISO 15924 script code for undetermined script aka Common.
+const char WebPreferences::kCommonScript[] = "Zyyy";
+
WebPreferences::WebPreferences()
- : standard_font_family(ASCIIToUTF16("Times New Roman")),
- fixed_font_family(ASCIIToUTF16("Courier New")),
- serif_font_family(ASCIIToUTF16("Times New Roman")),
- sans_serif_font_family(ASCIIToUTF16("Arial")),
- cursive_font_family(ASCIIToUTF16("Script")),
- fantasy_font_family(), // Not sure what to use on Windows.
- default_font_size(16),
+ : default_font_size(16),
default_fixed_font_size(13),
minimum_font_size(0),
minimum_logical_font_size(6),
@@ -107,6 +103,18 @@ WebPreferences::WebPreferences()
per_tile_painting_enabled(false),
css_regions_enabled(false),
css_shaders_enabled(false) {
+ standard_font_family_map[kCommonScript] =
+ ASCIIToUTF16("Times New Roman");
+ fixed_font_family_map[kCommonScript] =
+ ASCIIToUTF16("Courier New");
+ serif_font_family_map[kCommonScript] =
+ ASCIIToUTF16("Times New Roman");
+ sans_serif_font_family_map[kCommonScript] =
+ ASCIIToUTF16("Arial");
+ cursive_font_family_map[kCommonScript] =
+ ASCIIToUTF16("Script");
+ fantasy_font_family_map[kCommonScript] =
+ ASCIIToUTF16("Impact");
}
WebPreferences::~WebPreferences() {
@@ -168,12 +176,6 @@ void ApplyFontsFromMap(const WebPreferences::ScriptFontFamilyMap& map,
void WebPreferences::Apply(WebView* web_view) const {
WebSettings* settings = web_view->settings();
- settings->setStandardFontFamily(standard_font_family);
- settings->setFixedFontFamily(fixed_font_family);
- settings->setSerifFontFamily(serif_font_family);
- settings->setSansSerifFontFamily(sans_serif_font_family);
- settings->setCursiveFontFamily(cursive_font_family);
- settings->setFantasyFontFamily(fantasy_font_family);
ApplyFontsFromMap(standard_font_family_map, setStandardFontFamilyWrapper,
settings);
ApplyFontsFromMap(fixed_font_family_map, setFixedFontFamilyWrapper, settings);

Powered by Google App Engine
This is Rietveld 408576698