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

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

Issue 8118003: Changing fixed-width font size along with default when user changes in UI. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Added a notifyPrefChanged callback and changing dafault_fixed_font_size there. Created 9 years, 2 months 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 | « AUTHORS ('k') | 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..0847dc992ec86086a69e57b192c03b2d7d1f107a 100644
--- a/chrome/browser/resources/options/font_settings.js
+++ b/chrome/browser/resources/options/font_settings.js
@@ -34,6 +34,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 +88,22 @@ 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, fontSampleEl.style.fontFamily,
+ true);
+ },
+
+ /**
+ * 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, '');
},
/**
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698