diff options
6 files changed, 27 insertions, 21 deletions
diff --git a/chrome/browser/resources/options/advanced_options.js b/chrome/browser/resources/options/advanced_options.js index 846202d..fc0a2ee 100644 --- a/chrome/browser/resources/options/advanced_options.js +++ b/chrome/browser/resources/options/advanced_options.js @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -60,8 +60,11 @@ var OptionsPage = options.OptionsPage; chrome.send('coreOptionsUserMetricsAction', ['Options_FontSettings']); }; $('defaultFontSize').onchange = function(event) { - chrome.send('defaultFontSizeAction', - [String(event.target.options[event.target.selectedIndex].value)]); + var value = event.target.options[event.target.selectedIndex].value; + Preferences.setIntegerPref( + 'webkit.webprefs.global.default_fixed_font_size', + value - OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD, ''); + chrome.send('defaultFontSizeAction', [String(value)]); }; $('defaultZoomFactor').onchange = function(event) { chrome.send('defaultZoomFactorAction', diff --git a/chrome/browser/resources/options/font_settings.js b/chrome/browser/resources/options/font_settings.js index cd45510..66014e7 100644 --- a/chrome/browser/resources/options/font_settings.js +++ b/chrome/browser/resources/options/font_settings.js @@ -7,12 +7,6 @@ cr.define('options', function() { var OptionsPage = options.OptionsPage; /** - * This is the absolute difference maintained between standard and - * fixed-width font sizes. Refer http://crbug.com/91922. - */ - const SIZE_DIFFERENCE_FIXED_STANDARD = 3; - - /** * FontSettings class * Encapsulated handling of the 'Fonts and Encoding' page. * @class @@ -97,7 +91,7 @@ cr.define('options', function() { fontSampleEl = $('fixed-font-sample'); this.setUpFontSample_(fontSampleEl, - value - SIZE_DIFFERENCE_FIXED_STANDARD, + value - OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD, fontSampleEl.style.fontFamily, false); }, @@ -111,7 +105,7 @@ cr.define('options', function() { standardFontSizeChanged_: function(el, value) { Preferences.setIntegerPref( 'webkit.webprefs.global.default_fixed_font_size', - value - SIZE_DIFFERENCE_FIXED_STANDARD, ''); + value - OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD, ''); }, /** diff --git a/chrome/browser/resources/options/options_page.js b/chrome/browser/resources/options/options_page.js index 9143968..23eae45 100644 --- a/chrome/browser/resources/options/options_page.js +++ b/chrome/browser/resources/options/options_page.js @@ -26,6 +26,12 @@ cr.define('options', function() { const SUBPAGE_SHEET_COUNT = 2; /** + * This is the absolute difference maintained between standard and + * fixed-width font sizes. Refer http://crbug.com/91922. + */ + OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD = 3; + + /** * Main level option pages. Maps lower-case page names to the respective page * object. * @protected diff --git a/chrome/browser/resources/options2/advanced_options.js b/chrome/browser/resources/options2/advanced_options.js index 00dbebf..d3e712a 100644 --- a/chrome/browser/resources/options2/advanced_options.js +++ b/chrome/browser/resources/options2/advanced_options.js @@ -141,8 +141,11 @@ cr.define('options', function() { chrome.send('coreOptionsUserMetricsAction', ['Options_FontSettings']); }; $('defaultFontSize').onchange = function(event) { - chrome.send('defaultFontSizeAction', - [String(event.target.options[event.target.selectedIndex].value)]); + var value = event.target.options[event.target.selectedIndex].value; + Preferences.setIntegerPref( + 'webkit.webprefs.global.default_fixed_font_size', + value - OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD, ''); + chrome.send('defaultFontSizeAction', [String(value)]); }; $('defaultZoomFactor').onchange = function(event) { chrome.send('defaultZoomFactorAction', diff --git a/chrome/browser/resources/options2/font_settings.js b/chrome/browser/resources/options2/font_settings.js index b623d27..19d4cf6 100644 --- a/chrome/browser/resources/options2/font_settings.js +++ b/chrome/browser/resources/options2/font_settings.js @@ -7,12 +7,6 @@ cr.define('options', function() { var OptionsPage = options.OptionsPage; /** - * This is the absolute difference maintained between standard and - * fixed-width font sizes. Refer http://crbug.com/91922. - */ - const SIZE_DIFFERENCE_FIXED_STANDARD = 3; - - /** * FontSettings class * Encapsulated handling of the 'Fonts and Encoding' page. * @class @@ -101,7 +95,7 @@ cr.define('options', function() { fontSampleEl = $('fixed-font-sample'); this.setUpFontSample_(fontSampleEl, - value - SIZE_DIFFERENCE_FIXED_STANDARD, + value - OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD, fontSampleEl.style.fontFamily, false); }, @@ -115,7 +109,7 @@ cr.define('options', function() { standardFontSizeChanged_: function(el, value) { Preferences.setIntegerPref( 'webkit.webprefs.global.default_fixed_font_size', - value - SIZE_DIFFERENCE_FIXED_STANDARD, ''); + value - OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD, ''); }, /** diff --git a/chrome/browser/resources/options2/options_page.js b/chrome/browser/resources/options2/options_page.js index 96e2151..d84de73 100644 --- a/chrome/browser/resources/options2/options_page.js +++ b/chrome/browser/resources/options2/options_page.js @@ -26,6 +26,12 @@ cr.define('options', function() { const HORIZONTAL_OFFSET = 155; /** + * This is the absolute difference maintained between standard and + * fixed-width font sizes. Refer http://crbug.com/91922. + */ + OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD = 3; + + /** * Main level option pages. Maps lower-case page names to the respective page * object. * @protected |