diff options
author | jshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-16 23:44:12 +0000 |
---|---|---|
committer | jshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-16 23:44:12 +0000 |
commit | 11fb71de48a0801bfdbd6f8e9ac456e641000bc4 (patch) | |
tree | 302565ce25038d6ae497a0cb5ec0bb7634749321 | |
parent | 2c164cd4280e27070d64b403a4c5687c8d6ff9e5 (diff) | |
download | chromium_src-11fb71de48a0801bfdbd6f8e9ac456e641000bc4.zip chromium_src-11fb71de48a0801bfdbd6f8e9ac456e641000bc4.tar.gz chromium_src-11fb71de48a0801bfdbd6f8e9ac456e641000bc4.tar.bz2 |
Chrome-part of disabling web fonts by default while still alowing SVG fonts
(The webkit part is http://codereview.chromium.org/67209/show and
http://bugs.webkit.org/show_bug.cgi?id=25239 )
1. Adds '--enable-remote-fonts' command line switch
2. Adds a field ('enable_remote_fonts) to WebPreference
3. Pass the value of enable_remote_fonts to the corresponding field in WebCore::Settings (m_downloadableBinaryFontsEnabled)
BUG=9633
TEST: 1. Run Chrome with and without '--enable-remote-font' command line flag and go to http://www.alistapart.com/d/cssatten/heid.html. Without the flag, the page should be rendered with 'dull-looking ordinary' fonts. With the flag, the page should be rendered with 'decorative' remote fonts.
2. Even without the above flag, Chrome should should get 100/100, with no boxes in the upper right corner (still has the Linktest Failed error).
Review URL: http://codereview.chromium.org/67210
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16247 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/tab_contents/render_view_host_delegate_helper.cc | 2 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 4 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 1 | ||||
-rw-r--r-- | chrome/common/render_messages.h | 4 | ||||
-rw-r--r-- | webkit/glue/webpreferences.h | 2 | ||||
-rw-r--r-- | webkit/glue/webview_impl.cc | 1 |
6 files changed, 13 insertions, 1 deletions
diff --git a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc index 8390d6e..6132743 100644 --- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc +++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc @@ -165,6 +165,8 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs( prefs->GetBoolean(prefs::kWebKitLoadsImagesAutomatically); web_prefs.uses_page_cache = command_line.HasSwitch(switches::kEnableFastback); + web_prefs.remote_fonts_enabled = + command_line.HasSwitch(switches::kEnableRemoteFonts); } web_prefs.uses_universal_detector = diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 233259e..f9df29f 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -347,6 +347,10 @@ const wchar_t kDisablePlugins[] = L"disable-plugins"; // Prevent images from loading. const wchar_t kDisableImages[] = L"disable-images"; +// Enable remote web font support. SVG font should always work whether +// this option is specified or not. +const wchar_t kEnableRemoteFonts[] = L"enable-remote-fonts"; + // Use the low fragmentation heap for the CRT. const wchar_t kUseLowFragHeapCrt[] = L"use-lf-heap"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index f242ec9..539df1c 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -121,6 +121,7 @@ extern const wchar_t kDisableJava[]; extern const wchar_t kDisablePlugins[]; extern const wchar_t kDisableImages[]; extern const wchar_t kDisableWebSecurity[]; +extern const wchar_t kEnableRemoteFonts[]; extern const wchar_t kUseLowFragHeapCrt[]; diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index 768cd85..2908480 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -1522,6 +1522,7 @@ struct ParamTraits<WebPreferences> { WriteParam(m, p.user_style_sheet_enabled); WriteParam(m, p.user_style_sheet_location); WriteParam(m, p.uses_page_cache); + WriteParam(m, p.remote_fonts_enabled); } static bool Read(const Message* m, void** iter, param_type* p) { return @@ -1549,7 +1550,8 @@ struct ParamTraits<WebPreferences> { ReadParam(m, iter, &p->java_enabled) && ReadParam(m, iter, &p->user_style_sheet_enabled) && ReadParam(m, iter, &p->user_style_sheet_location) && - ReadParam(m, iter, &p->uses_page_cache); + ReadParam(m, iter, &p->uses_page_cache) && + ReadParam(m, iter, &p->remote_fonts_enabled); } static void Log(const param_type& p, std::wstring* l) { l->append(L"<WebPreferences>"); diff --git a/webkit/glue/webpreferences.h b/webkit/glue/webpreferences.h index 2a4cc60..ab38077 100644 --- a/webkit/glue/webpreferences.h +++ b/webkit/glue/webpreferences.h @@ -39,6 +39,7 @@ struct WebPreferences { bool java_enabled; bool allow_scripts_to_close_windows; bool uses_page_cache; + bool remote_fonts_enabled; // TODO(tc): User style sheets will not work in chrome because it tries to // load the style sheet using a request without a frame. @@ -73,6 +74,7 @@ struct WebPreferences { java_enabled(true), allow_scripts_to_close_windows(false), uses_page_cache(false), + remote_fonts_enabled(false), user_style_sheet_enabled(false) { } }; diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc index 53d0511..0e13f6e 100644 --- a/webkit/glue/webview_impl.cc +++ b/webkit/glue/webview_impl.cc @@ -1466,6 +1466,7 @@ void WebViewImpl::SetPreferences(const WebPreferences& preferences) { settings->setUserStyleSheetLocation(KURL()); } settings->setUsesPageCache(preferences.uses_page_cache); + settings->setDownloadableBinaryFontsEnabled(preferences.remote_fonts_enabled); // This setting affects the behavior of links in an editable region: // clicking the link should select it rather than navigate to it. |