Update to Chromium revision 137849.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@631 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-05-18 20:32:28 +00:00
parent 761187a673
commit 9c9711c2d8
12 changed files with 88 additions and 58 deletions

View File

@@ -14,27 +14,40 @@
#include "content/public/browser/gpu_data_manager.h"
#include "webkit/glue/webpreferences.h"
void BrowserToWebSettings(const CefBrowserSettings& cef,
webkit_glue::WebPreferences& web) {
if (cef.standard_font_family.length > 0)
web.standard_font_family = CefString(&cef.standard_font_family);
else
web.standard_font_family = ASCIIToUTF16("Times");
using webkit_glue::WebPreferences;
if (cef.fixed_font_family.length > 0)
web.fixed_font_family = CefString(&cef.fixed_font_family);
else
web.fixed_font_family = ASCIIToUTF16("Courier");
void BrowserToWebSettings(const CefBrowserSettings& cef, WebPreferences& web) {
if (cef.standard_font_family.length > 0) {
web.standard_font_family_map[WebPreferences::kCommonScript] =
CefString(&cef.standard_font_family);
} else {
web.standard_font_family_map[WebPreferences::kCommonScript] =
ASCIIToUTF16("Times");
}
if (cef.serif_font_family.length > 0)
web.serif_font_family = CefString(&cef.serif_font_family);
else
web.serif_font_family = ASCIIToUTF16("Times");
if (cef.fixed_font_family.length > 0) {
web.fixed_font_family_map[WebPreferences::kCommonScript] =
CefString(&cef.fixed_font_family);
} else {
web.fixed_font_family_map[WebPreferences::kCommonScript] =
ASCIIToUTF16("Courier");
}
if (cef.sans_serif_font_family.length > 0)
web.sans_serif_font_family = CefString(&cef.sans_serif_font_family);
else
web.sans_serif_font_family = ASCIIToUTF16("Helvetica");
if (cef.serif_font_family.length > 0) {
web.serif_font_family_map[WebPreferences::kCommonScript] =
CefString(&cef.serif_font_family);
} else {
web.serif_font_family_map[WebPreferences::kCommonScript] =
ASCIIToUTF16("Times");
}
if (cef.sans_serif_font_family.length > 0) {
web.sans_serif_font_family_map[WebPreferences::kCommonScript] =
CefString(&cef.sans_serif_font_family);
} else {
web.sans_serif_font_family_map[WebPreferences::kCommonScript] =
ASCIIToUTF16("Helvetica");
}
// These two fonts below are picked from the intersection of
// Win XP font list and Vista font list :
@@ -48,22 +61,26 @@ void BrowserToWebSettings(const CefBrowserSettings& cef,
// as long as they're available.
if (cef.cursive_font_family.length > 0) {
web.cursive_font_family = CefString(&cef.cursive_font_family);
web.cursive_font_family_map[WebPreferences::kCommonScript] =
CefString(&cef.cursive_font_family);
} else {
web.cursive_font_family_map[WebPreferences::kCommonScript] =
#if defined(OS_MACOSX)
web.cursive_font_family = ASCIIToUTF16("Apple Chancery");
ASCIIToUTF16("Apple Chancery");
#else
web.cursive_font_family = ASCIIToUTF16("Comic Sans MS");
ASCIIToUTF16("Comic Sans MS");
#endif
}
if (cef.fantasy_font_family.length > 0) {
web.fantasy_font_family = CefString(&cef.fantasy_font_family);
web.fantasy_font_family_map[WebPreferences::kCommonScript] =
CefString(&cef.fantasy_font_family);
} else {
web.fantasy_font_family_map[WebPreferences::kCommonScript] =
#if defined(OS_MACOSX)
web.fantasy_font_family = ASCIIToUTF16("Papyrus");
ASCIIToUTF16("Papyrus");
#else
web.fantasy_font_family = ASCIIToUTF16("Impact");
ASCIIToUTF16("Impact");
#endif
}