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..35372db12f0b4d3f443cb01bcad1ffa3c175906b 100644 |
--- a/chrome/browser/resources/options/font_settings.js |
+++ b/chrome/browser/resources/options/font_settings.js |
@@ -6,6 +6,8 @@ cr.define('options', function() { |
var OptionsPage = options.OptionsPage; |
+ const SizeDifferenceFixedStandard = 3; |
Peter Kasting
2011/11/04 16:22:33
Nit: I suggest adding some comments on what this m
groby-ooo-7-16
2011/11/08 19:05:17
nit: Please uppercase simple primitive constants.
rosen.dash
2011/11/09 07:04:02
Done.
rosen.dash
2011/11/09 07:04:02
Done.
|
+ |
/** |
* FontSettings class |
* Encapsulated handling of the 'Fonts and Encoding' page. |
@@ -34,6 +36,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 +90,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 - SizeDifferenceFixedStandard, |
Peter Kasting
2011/11/04 16:22:33
Nit: Should someone somewhere assert that this wil
groby-ooo-7-16
2011/11/08 19:05:17
Technically, standardRange has a minimum of '9', s
rosen.dash
2011/11/09 07:04:02
I think that it's not necessary to add an assert.
|
+ 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 - SizeDifferenceFixedStandard, ''); |
}, |
/** |