diff options
author | csilv@chromium.org <csilv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-01 23:39:10 +0000 |
---|---|---|
committer | csilv@chromium.org <csilv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-01 23:39:10 +0000 |
commit | 16480f67b506645b0630043a43e3f053bd7a64de (patch) | |
tree | 1970968224e608e3f88feecddff6fddedb88ef47 | |
parent | a03712972e4aab08210846a2c8fcea159b9d766f (diff) | |
download | chromium_src-16480f67b506645b0630043a43e3f053bd7a64de.zip chromium_src-16480f67b506645b0630043a43e3f053bd7a64de.tar.gz chromium_src-16480f67b506645b0630043a43e3f053bd7a64de.tar.bz2 |
web-ui settings: Standard font setting now correlates to WebKit's standard font family only.
BUG=74434
TEST=Verify that changing the 'standard font' only applies to unspecified font styles.
Review URL: http://codereview.chromium.org/6602021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76463 0039d316-1c4b-4281-b951-d872f2087c98
30 files changed, 60 insertions, 87 deletions
diff --git a/chrome/app/resources/locale_settings_cros.grd b/chrome/app/resources/locale_settings_cros.grd index c889b29..2e19308 100644 --- a/chrome/app/resources/locale_settings_cros.grd +++ b/chrome/app/resources/locale_settings_cros.grd @@ -142,10 +142,9 @@ 84% </message> - <!-- The default value to determine whether - |WebPreference::standard_font_family| is serif or sans-serif. --> - <message name="IDS_STANDARD_FONT_IS_SERIF" use_name_for_id="true"> - true + <!-- The default value for |WebPreference::standard_font_family| --> + <message name="IDS_STANDARD_FONT_FAMILY" use_name_for_id="true"> + Tinos </message> <!-- The default value for |WebPreference::fixed_font_family| --> diff --git a/chrome/app/resources/locale_settings_linux.grd b/chrome/app/resources/locale_settings_linux.grd index 7eb1589..d8c8958 100644 --- a/chrome/app/resources/locale_settings_linux.grd +++ b/chrome/app/resources/locale_settings_linux.grd @@ -142,10 +142,9 @@ 84% </message> - <!-- The default value to determine whether - |WebPreference::standard_font_family| is serif or sans-serif. --> - <message name="IDS_STANDARD_FONT_IS_SERIF" use_name_for_id="true"> - true + <!-- The default value for |WebPreference::standard_font_family| --> + <message name="IDS_STANDARD_FONT_FAMILY" use_name_for_id="true"> + Times New Roman </message> <!-- The default value for |WebPreference::fixed_font_family| --> diff --git a/chrome/app/resources/locale_settings_mac.grd b/chrome/app/resources/locale_settings_mac.grd index c7e816d..8064264 100644 --- a/chrome/app/resources/locale_settings_mac.grd +++ b/chrome/app/resources/locale_settings_mac.grd @@ -124,10 +124,9 @@ 84% </message> - <!-- The default value to determine whether - |WebPreference::standard_font_family| is serif or sans-serif. --> - <message name="IDS_STANDARD_FONT_IS_SERIF" use_name_for_id="true"> - true + <!-- The default value for |WebPreference::standard_font_family| --> + <message name="IDS_STANDARD_FONT_FAMILY" use_name_for_id="true"> + Times </message> <!-- The default value for |WebPreference::fixed_font_family| --> diff --git a/chrome/app/resources/locale_settings_win.grd b/chrome/app/resources/locale_settings_win.grd index 4415997..45f30f5 100644 --- a/chrome/app/resources/locale_settings_win.grd +++ b/chrome/app/resources/locale_settings_win.grd @@ -129,10 +129,9 @@ 84% </message> - <!-- The default value to determine whether - |WebPreference::standard_font_family| is serif or sans-serif. --> - <message name="IDS_STANDARD_FONT_IS_SERIF" use_name_for_id="true"> - true + <!-- The default value for |WebPreference::standard_font_family| --> + <message name="IDS_STANDARD_FONT_FAMILY" use_name_for_id="true"> + Times New Roman </message> <!-- The default value for |WebPreference::fixed_font_family| --> diff --git a/chrome/app/resources/platform_locale_settings/locale_settings_cros_ja.xtb b/chrome/app/resources/platform_locale_settings/locale_settings_cros_ja.xtb index ded57b5..f2646f7 100644 --- a/chrome/app/resources/platform_locale_settings/locale_settings_cros_ja.xtb +++ b/chrome/app/resources/platform_locale_settings/locale_settings_cros_ja.xtb @@ -1,7 +1,7 @@ <?xml version="1.0" ?> <!DOCTYPE translationbundle> <translationbundle lang="ja"> -<translation id="IDS_STANDARD_FONT_IS_SERIF">false</translation> +<translation id="IDS_STANDARD_FONT_FAMILY">IPAPGothic</translation> <translation id="IDS_WEB_FONT_FAMILY">Chrome Droid Sans, Droid Sans Japanese, sans-serif</translation> <translation id="IDS_FIXED_FONT_FAMILY">IPAGothic</translation> <translation id="IDS_SERIF_FONT_FAMILY">IPAPMincho</translation> diff --git a/chrome/app/resources/platform_locale_settings/locale_settings_cros_ko.xtb b/chrome/app/resources/platform_locale_settings/locale_settings_cros_ko.xtb index 276032b..4088cf7 100644 --- a/chrome/app/resources/platform_locale_settings/locale_settings_cros_ko.xtb +++ b/chrome/app/resources/platform_locale_settings/locale_settings_cros_ko.xtb @@ -1,7 +1,7 @@ <?xml version="1.0" ?> <!DOCTYPE translationbundle> <translationbundle lang="ko"> -<translation id="IDS_STANDARD_FONT_IS_SERIF">false</translation> +<translation id="IDS_STANDARD_FONT_FAMILY">Gulim</translation> <translation id="IDS_FIXED_FONT_FAMILY">Gulimche</translation> <translation id="IDS_SERIF_FONT_FAMILY">Batang</translation> <translation id="IDS_SANS_SERIF_FONT_FAMILY">Gulim</translation> diff --git a/chrome/app/resources/platform_locale_settings/locale_settings_cros_zh-CN.xtb b/chrome/app/resources/platform_locale_settings/locale_settings_cros_zh-CN.xtb index cfd0e31..5b2461e 100644 --- a/chrome/app/resources/platform_locale_settings/locale_settings_cros_zh-CN.xtb +++ b/chrome/app/resources/platform_locale_settings/locale_settings_cros_zh-CN.xtb @@ -1,7 +1,7 @@ <?xml version="1.0" ?> <!DOCTYPE translationbundle> <translationbundle lang="zh-CN"> -<translation id="IDS_STANDARD_FONT_IS_SERIF">false</translation> +<translation id="IDS_STANDARD_FONT_FAMILY">Droid Sans Fallback</translation> <translation id="IDS_FIXED_FONT_FAMILY">NSong ASC</translation> <translation id="IDS_SERIF_FONT_FAMILY">Song ASC</translation> <translation id="IDS_SANS_SERIF_FONT_FAMILY">Droid Sans Fallback</translation> diff --git a/chrome/app/resources/platform_locale_settings/locale_settings_cros_zh-TW.xtb b/chrome/app/resources/platform_locale_settings/locale_settings_cros_zh-TW.xtb index 83f3e75..1c94f55 100644 --- a/chrome/app/resources/platform_locale_settings/locale_settings_cros_zh-TW.xtb +++ b/chrome/app/resources/platform_locale_settings/locale_settings_cros_zh-TW.xtb @@ -1,7 +1,7 @@ <?xml version="1.0" ?> <!DOCTYPE translationbundle> <translationbundle lang="zh-TW"> -<translation id="IDS_STANDARD_FONT_IS_SERIF">false</translation> +<translation id="IDS_STANDARD_FONT_FAMILY">Droid Sans Fallback</translation> <translation id="IDS_FIXED_FONT_FAMILY">MingLiu</translation> <translation id="IDS_SERIF_FONT_FAMILY">PMingLiu</translation> <translation id="IDS_SANS_SERIF_FONT_FAMILY">Droid Sans Fallback</translation> diff --git a/chrome/app/resources/platform_locale_settings/locale_settings_linux_ja.xtb b/chrome/app/resources/platform_locale_settings/locale_settings_linux_ja.xtb index dfab18f..683de75 100644 --- a/chrome/app/resources/platform_locale_settings/locale_settings_linux_ja.xtb +++ b/chrome/app/resources/platform_locale_settings/locale_settings_linux_ja.xtb @@ -1,7 +1,7 @@ <?xml version="1.0" ?> <!DOCTYPE translationbundle> <translationbundle lang="ja"> -<translation id="IDS_STANDARD_FONT_IS_SERIF">false</translation> +<translation id="IDS_STANDARD_FONT_FAMILY">VL PGothic</translation> <translation id="IDS_WEB_FONT_FAMILY">VL PGothic,Sazanami Gothic,Kochi Gothic,sans-serif</translation> <translation id="IDS_FIXED_FONT_FAMILY">VL Gothic</translation> <translation id="IDS_SERIF_FONT_FAMILY">Sazanami Mincho</translation> diff --git a/chrome/app/resources/platform_locale_settings/locale_settings_linux_ko.xtb b/chrome/app/resources/platform_locale_settings/locale_settings_linux_ko.xtb index f127c8b..0edc7fb 100644 --- a/chrome/app/resources/platform_locale_settings/locale_settings_linux_ko.xtb +++ b/chrome/app/resources/platform_locale_settings/locale_settings_linux_ko.xtb @@ -1,7 +1,7 @@ <?xml version="1.0" ?> <!DOCTYPE translationbundle> <translationbundle lang="ko"> -<translation id="IDS_STANDARD_FONT_IS_SERIF">false</translation> +<translation id="IDS_STANDARD_FONT_FAMILY">UnDotum</translation> <translation id="IDS_WEB_FONT_FAMILY">NanumGothic,UnDotum,Baekmuk Gulim,sans-serif</translation> <translation id="IDS_FIXED_FONT_FAMILY">UnDotum</translation> <translation id="IDS_SERIF_FONT_FAMILY">UnBatang</translation> diff --git a/chrome/app/resources/platform_locale_settings/locale_settings_linux_zh-CN.xtb b/chrome/app/resources/platform_locale_settings/locale_settings_linux_zh-CN.xtb index 5916773..c63dd0a 100644 --- a/chrome/app/resources/platform_locale_settings/locale_settings_linux_zh-CN.xtb +++ b/chrome/app/resources/platform_locale_settings/locale_settings_linux_zh-CN.xtb @@ -1,7 +1,7 @@ <?xml version="1.0" ?> <!DOCTYPE translationbundle> <translationbundle lang="zh-CN"> -<translation id="IDS_STANDARD_FONT_IS_SERIF">false</translation> +<translation id="IDS_STANDARD_FONT_FAMILY">AR PL UKai CN</translation> <translation id="IDS_WEB_FONT_FAMILY">AR PL UKai CN,sans-serif</translation> <translation id="IDS_FIXED_FONT_FAMILY">AR PL UKai CN</translation> <translation id="IDS_SERIF_FONT_FAMILY">AR PL UMing CN</translation> diff --git a/chrome/app/resources/platform_locale_settings/locale_settings_linux_zh-TW.xtb b/chrome/app/resources/platform_locale_settings/locale_settings_linux_zh-TW.xtb index ca80901..9de9059 100644 --- a/chrome/app/resources/platform_locale_settings/locale_settings_linux_zh-TW.xtb +++ b/chrome/app/resources/platform_locale_settings/locale_settings_linux_zh-TW.xtb @@ -2,7 +2,6 @@ <!DOCTYPE translationbundle> <translationbundle lang="zh-TW"> <translation id="IDS_WEB_FONT_FAMILY">AR PL UKai TW,sans-serif</translation> -<translation id="IDS_STANDARD_FONT_IS_SERIF">false</translation> <translation id="IDS_MINIMUM_FONT_SIZE">12</translation> <translation id="IDS_MINIMUM_LOGICAL_FONT_SIZE">12</translation> </translationbundle> diff --git a/chrome/app/resources/platform_locale_settings/locale_settings_mac_ja.xtb b/chrome/app/resources/platform_locale_settings/locale_settings_mac_ja.xtb index 4f4fc0c..8ac22ee 100644 --- a/chrome/app/resources/platform_locale_settings/locale_settings_mac_ja.xtb +++ b/chrome/app/resources/platform_locale_settings/locale_settings_mac_ja.xtb @@ -1,7 +1,7 @@ <?xml version="1.0" ?> <!DOCTYPE translationbundle> <translationbundle lang="ja"> -<translation id="IDS_STANDARD_FONT_IS_SERIF">false</translation> +<translation id="IDS_STANDARD_FONT_FAMILY">Hiragino Kaku Gothic Pro</translation> <translation id="IDS_WEB_FONT_FAMILY">Helvetica,Hiragino Kaku Gothic Pro,sans-serif</translation> <translation id="IDS_FIXED_FONT_FAMILY">Osaka-Mono</translation> <translation id="IDS_SERIF_FONT_FAMILY">Hiragino Mincho Pro</translation> diff --git a/chrome/app/resources/platform_locale_settings/locale_settings_mac_ko.xtb b/chrome/app/resources/platform_locale_settings/locale_settings_mac_ko.xtb index 0ba3567..60a2761 100644 --- a/chrome/app/resources/platform_locale_settings/locale_settings_mac_ko.xtb +++ b/chrome/app/resources/platform_locale_settings/locale_settings_mac_ko.xtb @@ -1,7 +1,7 @@ <?xml version="1.0" ?> <!DOCTYPE translationbundle> <translationbundle lang="ko"> -<translation id="IDS_STANDARD_FONT_IS_SERIF">false</translation> +<translation id="IDS_STANDARD_FONT_FAMILY">AppleGothic</translation> <translation id="IDS_WEB_FONT_FAMILY">Helvetica,AppleGothic,sans-serif</translation> <translation id="IDS_SERIF_FONT_FAMILY">AppleMyungjo</translation> <translation id="IDS_SANS_SERIF_FONT_FAMILY">AppleGothic</translation> diff --git a/chrome/app/resources/platform_locale_settings/locale_settings_mac_zh-CN.xtb b/chrome/app/resources/platform_locale_settings/locale_settings_mac_zh-CN.xtb index 92464ec..5a45cf15 100644 --- a/chrome/app/resources/platform_locale_settings/locale_settings_mac_zh-CN.xtb +++ b/chrome/app/resources/platform_locale_settings/locale_settings_mac_zh-CN.xtb @@ -1,7 +1,7 @@ <?xml version="1.0" ?> <!DOCTYPE translationbundle> <translationbundle lang="zh-CN"> -<translation id="IDS_STANDARD_FONT_IS_SERIF">false</translation> +<translation id="IDS_STANDARD_FONT_FAMILY">STHeiti</translation> <translation id="IDS_WEB_FONT_FAMILY">Helvetica,STHeiti,sans-serif</translation> <translation id="IDS_SERIF_FONT_FAMILY">STSong</translation> <translation id="IDS_SANS_SERIF_FONT_FAMILY">STHeiti</translation> diff --git a/chrome/app/resources/platform_locale_settings/locale_settings_mac_zh-TW.xtb b/chrome/app/resources/platform_locale_settings/locale_settings_mac_zh-TW.xtb index a5d29f7..09b7105 100644 --- a/chrome/app/resources/platform_locale_settings/locale_settings_mac_zh-TW.xtb +++ b/chrome/app/resources/platform_locale_settings/locale_settings_mac_zh-TW.xtb @@ -2,7 +2,7 @@ <!DOCTYPE translationbundle> <translationbundle lang="zh-TW"> <translation id="IDS_WEB_FONT_FAMILY">Helvetica,LiHei Pro,sans-serif</translation> -<translation id="IDS_STANDARD_FONT_IS_SERIF">false</translation> +<translation id="IDS_STANDARD_FONT_FAMILY">LiHei Pro</translation> <translation id="IDS_SERIF_FONT_FAMILY">LiSong Pro</translation> <translation id="IDS_SANS_SERIF_FONT_FAMILY">LiHei Pro</translation> <translation id="IDS_MINIMUM_FONT_SIZE">12</translation> diff --git a/chrome/app/resources/platform_locale_settings/locale_settings_win_ja.xtb b/chrome/app/resources/platform_locale_settings/locale_settings_win_ja.xtb index 3329fa5..372c955 100644 --- a/chrome/app/resources/platform_locale_settings/locale_settings_win_ja.xtb +++ b/chrome/app/resources/platform_locale_settings/locale_settings_win_ja.xtb @@ -1,7 +1,7 @@ <?xml version="1.0" ?> <!DOCTYPE translationbundle> <translationbundle lang="ja"> -<translation id="IDS_STANDARD_FONT_IS_SERIF">false</translation> +<translation id="IDS_STANDARD_FONT_FAMILY">MS PGothic</translation> <translation id="IDS_WEB_FONT_FAMILY">Arial,Meiryo,MS PGothic,sans-serif</translation> <translation id="IDS_FIXED_FONT_FAMILY">MS Gothic</translation> <translation id="IDS_SERIF_FONT_FAMILY">MS PMincho</translation> diff --git a/chrome/app/resources/platform_locale_settings/locale_settings_win_ko.xtb b/chrome/app/resources/platform_locale_settings/locale_settings_win_ko.xtb index b4a4199..fc65878 100644 --- a/chrome/app/resources/platform_locale_settings/locale_settings_win_ko.xtb +++ b/chrome/app/resources/platform_locale_settings/locale_settings_win_ko.xtb @@ -1,7 +1,7 @@ <?xml version="1.0" ?> <!DOCTYPE translationbundle> <translationbundle lang="ko"> -<translation id="IDS_STANDARD_FONT_IS_SERIF">false</translation> +<translation id="IDS_STANDARD_FONT_FAMILY">Gulim</translation> <translation id="IDS_WEB_FONT_FAMILY">Arial,Malgun Gothic,Gulim,sans-serif</translation> <translation id="IDS_FIXED_FONT_FAMILY">Gulimche</translation> <translation id="IDS_SERIF_FONT_FAMILY">Batang</translation> diff --git a/chrome/app/resources/platform_locale_settings/locale_settings_win_zh-CN.xtb b/chrome/app/resources/platform_locale_settings/locale_settings_win_zh-CN.xtb index 2d0f2c4..a82c87a 100644 --- a/chrome/app/resources/platform_locale_settings/locale_settings_win_zh-CN.xtb +++ b/chrome/app/resources/platform_locale_settings/locale_settings_win_zh-CN.xtb @@ -1,7 +1,7 @@ <?xml version="1.0" ?> <!DOCTYPE translationbundle> <translationbundle lang="zh-CN"> -<translation id="IDS_STANDARD_FONT_IS_SERIF">false</translation> +<translation id="IDS_STANDARD_FONT_FAMILY">Simsun</translation> <translation id="IDS_WEB_FONT_FAMILY">Arial,Microsoft Yahei,Simsun,sans-serif</translation> <translation id="IDS_FIXED_FONT_FAMILY">NSimsun</translation> <translation id="IDS_SERIF_FONT_FAMILY">Simsun</translation> diff --git a/chrome/app/resources/platform_locale_settings/locale_settings_win_zh-TW.xtb b/chrome/app/resources/platform_locale_settings/locale_settings_win_zh-TW.xtb index 29c2bdd..5edc240 100644 --- a/chrome/app/resources/platform_locale_settings/locale_settings_win_zh-TW.xtb +++ b/chrome/app/resources/platform_locale_settings/locale_settings_win_zh-TW.xtb @@ -2,7 +2,6 @@ <!DOCTYPE translationbundle> <translationbundle lang="zh-TW"> <translation id="IDS_WEB_FONT_FAMILY">Arial,Microsoft Jhenghei,PMingLiu,sans-serif</translation> -<translation id="IDS_STANDARD_FONT_IS_SERIF">false</translation> <translation id="IDS_MINIMUM_FONT_SIZE">12</translation> <translation id="IDS_MINIMUM_LOGICAL_FONT_SIZE">12</translation> </translationbundle> diff --git a/chrome/browser/resources/options/font_settings.html b/chrome/browser/resources/options/font_settings.html index 3fa1ac9..e1168b6 100644 --- a/chrome/browser/resources/options/font_settings.html +++ b/chrome/browser/resources/options/font_settings.html @@ -4,12 +4,12 @@ <h3 i18n-content="fontSettingsStandard"></h3> <div class="font-input-div"> <div> - <select id="serif-font-family" class="font-input" dataType="string" - pref="webkit.webprefs.serif_font_family" - metric="Options_ChangeSerifFont" disabled></select> + <select id="standard-font-family" class="font-input" dataType="string" + pref="webkit.webprefs.standard_font_family" + metric="Options_ChangeStandardFont" disabled></select> </div> <div> - <input id="serif-font-size" type="range" min="0" max="24" + <input id="standard-font-size" type="range" min="0" max="24" pref="webkit.webprefs.default_font_size" class="font-input"> <div> <span i18n-content="fontSettingsSizeTiny"></span> @@ -18,7 +18,7 @@ </div> </div> </div> - <div id="serif-font-sample" class="font-sample-div"></div> + <div id="standard-font-sample" class="font-sample-div"></div> </section> <section> <h3 i18n-content="fontSettingsFixedWidth"></h3> diff --git a/chrome/browser/resources/options/font_settings.js b/chrome/browser/resources/options/font_settings.js index 00a43e9..2c5cc84 100644 --- a/chrome/browser/resources/options/font_settings.js +++ b/chrome/browser/resources/options/font_settings.js @@ -29,13 +29,13 @@ cr.define('options', function() { initializePage: function() { OptionsPage.prototype.initializePage.call(this); - var serifFontRange = $('serif-font-size'); - serifFontRange.valueMap = $('fixed-font-size').valueMap = [9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 40, 44, - 48, 56, 64, 72]; - serifFontRange.continuous = false; - serifFontRange.fontSampleEl = $('serif-font-sample'); - serifFontRange.notifyChange = this.rangeChanged_.bind(this); + var standardFontRange = $('standard-font-size'); + standardFontRange.valueMap = $('fixed-font-size').valueMap = [9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 40, + 44, 48, 56, 64, 72]; + standardFontRange.continuous = false; + standardFontRange.fontSampleEl = $('standard-font-sample'); + standardFontRange.notifyChange = this.rangeChanged_.bind(this); var minimumFontRange = $('minimum-font-size'); minimumFontRange.valueMap = [9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, @@ -47,17 +47,9 @@ cr.define('options', function() { this.minimumFontSizeChanged_.bind(this); var placeholder = localStrings.getString('fontSettingsPlaceholder'); - $('serif-font-family').appendChild(new Option(placeholder)); + $('standard-font-family').appendChild(new Option(placeholder)); $('fixed-font-family').appendChild(new Option(placeholder)); $('font-encoding').appendChild(new Option(placeholder)); - - // Add an additional listener to the font select menu for the - // 'sansserif_font_family' preference. - $('serif-font-family').addEventListener('change', - function(e) { - Preferences.setStringPref('webkit.webprefs.sansserif_font_family', - this.options[this.selectedIndex].value, ''); - }); }, /** @@ -145,7 +137,7 @@ cr.define('options', function() { // Chrome callbacks FontSettings.setFontsData = function(fonts, encodings, selectedValues) { - FontSettings.getInstance().populateSelect_($('serif-font-family'), fonts, + FontSettings.getInstance().populateSelect_($('standard-font-family'), fonts, selectedValues[0]); FontSettings.getInstance().populateSelect_($('fixed-font-family'), fonts, selectedValues[1]); @@ -153,8 +145,8 @@ cr.define('options', function() { selectedValues[2]); }; - FontSettings.setupSerifFontSample = function(font, size) { - FontSettings.getInstance().setupFontSample_($('serif-font-sample'), size, + FontSettings.setupStandardFontSample = function(font, size) { + FontSettings.getInstance().setupFontSample_($('standard-font-sample'), size, font); }; 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 1acf625..45351b9 100644 --- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc +++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc @@ -197,16 +197,14 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs( PrefService* prefs = profile->GetPrefs(); WebPreferences web_prefs; + web_prefs.standard_font_family = + UTF8ToUTF16(prefs->GetString(prefs::kWebKitStandardFontFamily)); web_prefs.fixed_font_family = UTF8ToUTF16(prefs->GetString(prefs::kWebKitFixedFontFamily)); web_prefs.serif_font_family = UTF8ToUTF16(prefs->GetString(prefs::kWebKitSerifFontFamily)); web_prefs.sans_serif_font_family = UTF8ToUTF16(prefs->GetString(prefs::kWebKitSansSerifFontFamily)); - if (prefs->GetBoolean(prefs::kWebKitStandardFontIsSerif)) - web_prefs.standard_font_family = web_prefs.serif_font_family; - else - web_prefs.standard_font_family = web_prefs.sans_serif_font_family; web_prefs.cursive_font_family = UTF8ToUTF16(prefs->GetString(prefs::kWebKitCursiveFontFamily)); web_prefs.fantasy_font_family = diff --git a/chrome/browser/tab_contents/web_contents_unittest.cc b/chrome/browser/tab_contents/web_contents_unittest.cc index ca05179..0bc1463 100644 --- a/chrome/browser/tab_contents/web_contents_unittest.cc +++ b/chrome/browser/tab_contents/web_contents_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -213,8 +213,6 @@ class TabContentsTest : public RenderViewHostTestHarness { Value::CreateBooleanValue(false)); pref_services->SetUserPref(prefs::kWebKitUsesUniversalDetector, Value::CreateBooleanValue(true)); - pref_services->SetUserPref(prefs::kWebKitStandardFontIsSerif, - Value::CreateBooleanValue(true)); pref_services->SetUserPref("webkit.webprefs.foo", Value::CreateStringValue("bar")); diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc index 73b47b2..7dc81f8 100644 --- a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc +++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc @@ -95,8 +95,8 @@ void TabContentsWrapper::RegisterUserPrefs(PrefService* prefs) { IDS_ACCEPT_LANGUAGES); prefs->RegisterLocalizedStringPref(prefs::kDefaultCharset, IDS_DEFAULT_ENCODING); - prefs->RegisterLocalizedBooleanPref(prefs::kWebKitStandardFontIsSerif, - IDS_STANDARD_FONT_IS_SERIF); + prefs->RegisterLocalizedStringPref(prefs::kWebKitStandardFontFamily, + IDS_STANDARD_FONT_FAMILY); prefs->RegisterLocalizedStringPref(prefs::kWebKitFixedFontFamily, IDS_FIXED_FONT_FAMILY); prefs->RegisterLocalizedStringPref(prefs::kWebKitSerifFontFamily, diff --git a/chrome/browser/ui/webui/options/font_settings_handler.cc b/chrome/browser/ui/webui/options/font_settings_handler.cc index d527746..f000fbf 100644 --- a/chrome/browser/ui/webui/options/font_settings_handler.cc +++ b/chrome/browser/ui/webui/options/font_settings_handler.cc @@ -68,7 +68,7 @@ void FontSettingsHandler::GetLocalizedValues( void FontSettingsHandler::Initialize() { DCHECK(web_ui_); - SetupSerifFontSample(); + SetupStandardFontSample(); SetupMinimumFontSample(); SetupFixedFontSample(); } @@ -83,7 +83,7 @@ WebUIMessageHandler* FontSettingsHandler::Attach(WebUI* web_ui) { FontSettingsUtilities::ValidateSavedFonts(pref_service); // Register for preferences that we need to observe manually. - serif_font_.Init(prefs::kWebKitSerifFontFamily, pref_service, this); + standard_font_.Init(prefs::kWebKitStandardFontFamily, pref_service, this); fixed_font_.Init(prefs::kWebKitFixedFontFamily, pref_service, this); font_encoding_.Init(prefs::kDefaultCharset, pref_service, this); default_font_size_.Init(prefs::kWebKitDefaultFontSize, pref_service, this); @@ -137,7 +137,7 @@ void FontSettingsHandler::FontsListHasLoaded() { } ListValue selected_values; - selected_values.Append(Value::CreateStringValue(serif_font_.GetValue())); + selected_values.Append(Value::CreateStringValue(standard_font_.GetValue())); selected_values.Append(Value::CreateStringValue(fixed_font_.GetValue())); selected_values.Append(Value::CreateStringValue(font_encoding_.GetValue())); @@ -150,9 +150,9 @@ void FontSettingsHandler::Observe(NotificationType type, const NotificationDetails& details) { if (type == NotificationType::PREF_CHANGED) { std::string* pref_name = Details<std::string>(details).ptr(); - if (*pref_name == prefs::kWebKitSerifFontFamily || + if (*pref_name == prefs::kWebKitStandardFontFamily || *pref_name == prefs::kWebKitDefaultFontSize) { - SetupSerifFontSample(); + SetupStandardFontSample(); } else if (*pref_name == prefs::kWebKitFixedFontFamily || *pref_name == prefs::kWebKitDefaultFixedFontSize) { SetupFixedFontSample(); @@ -162,11 +162,11 @@ void FontSettingsHandler::Observe(NotificationType type, } } -void FontSettingsHandler::SetupSerifFontSample() { - StringValue font_value(serif_font_.GetValue()); +void FontSettingsHandler::SetupStandardFontSample() { + StringValue font_value(standard_font_.GetValue()); FundamentalValue size_value(default_font_size_.GetValue()); web_ui_->CallJavascriptFunction( - L"FontSettings.setupSerifFontSample", font_value, size_value); + L"FontSettings.setupStandardFontSample", font_value, size_value); } void FontSettingsHandler::SetupFixedFontSample() { diff --git a/chrome/browser/ui/webui/options/font_settings_handler.h b/chrome/browser/ui/webui/options/font_settings_handler.h index 6a0371f..0f19016 100644 --- a/chrome/browser/ui/webui/options/font_settings_handler.h +++ b/chrome/browser/ui/webui/options/font_settings_handler.h @@ -36,11 +36,11 @@ class FontSettingsHandler : public OptionsPageUIHandler, private: void HandleFetchFontsData(const ListValue* args); - void SetupSerifFontSample(); + void SetupStandardFontSample(); void SetupFixedFontSample(); void SetupMinimumFontSample(); - StringPrefMember serif_font_; + StringPrefMember standard_font_; StringPrefMember fixed_font_; StringPrefMember font_encoding_; IntegerPrefMember default_font_size_; diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index 21c61b2..1d6b50a 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc @@ -99,13 +99,7 @@ const char kStaticEncodings[] = "intl.static_encodings"; const char kPopupWhitelistedHosts[] = "profile.popup_whitelisted_sites"; // WebKit preferences. -// A boolean flag to indicate whether WebKit standard font family is -// serif or sans-serif. We don't have a UI for setting standard family. -// Instead, we use this pref to map either serif or sans_serif to WebKit -// standard font family. At the moment, we don't have a UI for this -// flag, either. -const char kWebKitStandardFontIsSerif[] = - "webkit.webprefs.standard_font_is_serif"; +const char kWebKitStandardFontFamily[] = "webkit.webprefs.standard_font_family"; const char kWebKitFixedFontFamily[] = "webkit.webprefs.fixed_font_family"; const char kWebKitSerifFontFamily[] = "webkit.webprefs.serif_font_family"; const char kWebKitSansSerifFontFamily[] = diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index 6f7f2d6..8eef3c7 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h @@ -36,7 +36,7 @@ extern const char kAcceptLanguages[]; extern const char kStaticEncodings[]; extern const char kPopupWhitelistedHosts[]; extern const char kShowBookmarkBar[]; -extern const char kWebKitStandardFontIsSerif[]; +extern const char kWebKitStandardFontFamily[]; extern const char kWebKitFixedFontFamily[]; extern const char kWebKitSerifFontFamily[]; extern const char kWebKitSansSerifFontFamily[]; diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc index 6f93e14..4069494 100644 --- a/content/browser/tab_contents/tab_contents.cc +++ b/content/browser/tab_contents/tab_contents.cc @@ -169,6 +169,7 @@ const char* kPrefsToObserve[] = { prefs::kWebKitLoadsImagesAutomatically, prefs::kWebKitPluginsEnabled, prefs::kWebKitUsesUniversalDetector, + prefs::kWebKitStandardFontFamily, prefs::kWebKitSerifFontFamily, prefs::kWebKitSansSerifFontFamily, prefs::kWebKitFixedFontFamily, @@ -178,10 +179,6 @@ const char* kPrefsToObserve[] = { prefs::kWebKitMinimumLogicalFontSize, prefs::kWebkitTabsToLinks, prefs::kDefaultCharset - // kWebKitStandardFontIsSerif needs to be added - // if we let users pick which font to use, serif or sans-serif when - // no font is specified or a CSS generic family (serif or sans-serif) - // is not specified. }; const int kPrefsToObserveLength = arraysize(kPrefsToObserve); |