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

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

Issue 6577029: web-ui settings: Explicitly set preferences for sans-serif font and minimum l... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 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
Index: chrome/browser/resources/options/font_settings.js
===================================================================
--- chrome/browser/resources/options/font_settings.js (revision 75929)
+++ chrome/browser/resources/options/font_settings.js (working copy)
@@ -43,10 +43,24 @@
minimumFontRange.continuous = false;
minimumFontRange.fontSampleEl = $('minimum-font-sample');
minimumFontRange.notifyChange = this.rangeChanged_.bind(this);
+ minimumFontRange.notifyPrefChange =
+ this.minimumFontSizeChanged_.bind(this);
+
+ // 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, '');
+ });
},
/**
- * @inheritDoc
+ * Called as the user changes a non-continuous slider. This allows for
+ * reflecting the change in the UI before the preference has been changed.
+ * @param {Element} el The slider input element.
+ * @param {number} value The mapped value currently set by the slider.
+ * @private
*/
rangeChanged_: function(el, value) {
this.setupFontSample_(
@@ -54,6 +68,18 @@
},
/**
+ * Sets the 'minimum_logical_font_size' preference when the minimum 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
+ */
+ minimumFontSizeChanged_: function(el, value) {
+ Preferences.setIntegerPref('webkit.webprefs.minimum_logical_font_size',
+ value, '');
+ },
+
+ /**
* Sets the text, font size and font family of the sample text.
* @param {Element} el The div containing the sample text.
* @param {number} size The font size of the sample text.
« no previous file with comments | « chrome/browser/resources/options/font_settings.html ('k') | chrome/browser/resources/options/font_settings_ui.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698