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

Unified Diff: chrome/browser/resources/options/font_settings.js

Issue 8467004: Update on Issue 8118003. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Changes corresponding comments. Created 9 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/font_settings.js
diff --git a/chrome/browser/resources/options/font_settings.js b/chrome/browser/resources/options/font_settings.js
index dfde2f60e22c21b39e4e79c2b236e49f0f880863..c00f52580dac2ba65d6128ad9c78f0b7f67d78e3 100644
--- a/chrome/browser/resources/options/font_settings.js
+++ b/chrome/browser/resources/options/font_settings.js
@@ -7,6 +7,12 @@ 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
@@ -34,6 +40,8 @@ cr.define('options', function() {
22, 24, 26, 28, 30, 32, 34, 36, 40, 44, 48, 56, 64, 72];
standardFontRange.continuous = false;
standardFontRange.notifyChange = this.standardRangeChanged_.bind(this);
+ standardFontRange.notifyPrefChange =
+ this.standardFontSizeChanged_.bind(this);
var minimumFontRange = $('minimum-font-size');
minimumFontRange.valueMap = [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
@@ -86,6 +94,23 @@ cr.define('options', function() {
fontSampleEl = $('sans-serif-font-sample');
this.setUpFontSample_(fontSampleEl, value, fontSampleEl.style.fontFamily,
true);
+
+ fontSampleEl = $('fixed-font-sample');
+ this.setUpFontSample_(fontSampleEl,
+ value - SIZE_DIFFERENCE_FIXED_STANDARD,
+ fontSampleEl.style.fontFamily, false);
+ },
+
+ /**
+ * Sets the 'default_fixed_font_size' preference when the standard font
+ * size has been changed by the user.
+ * @param {Element} el The slider input element.
+ * @param {number} value The mapped value that has been saved.
+ * @private
+ */
+ standardFontSizeChanged_: function(el, value) {
+ Preferences.setIntegerPref('webkit.webprefs.default_fixed_font_size',
+ value - SIZE_DIFFERENCE_FIXED_STANDARD, '');
},
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698