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

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

Issue 10908061: Clean up copy-and-pasted code in prefs UI classes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nit addressed. Created 8 years, 3 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 | « no previous file | chrome/browser/resources/options/pref_ui.js » ('j') | 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 d0af96a62712c700a5bd7a2976707dd4db8125c4..965df6ef49566a35de1148e417b97922283bbfbe 100644
--- a/chrome/browser/resources/options/font_settings.js
+++ b/chrome/browser/resources/options/font_settings.js
@@ -82,22 +82,22 @@ cr.define('options', function() {
* @private
*/
standardRangeChanged_: function(el, event) {
- var value = el.mapValueToRange(el.value);
+ var size = el.mapPositionToPref(el.value);
var fontSampleEl = $('standard-font-sample');
- this.setUpFontSample_(fontSampleEl, value, fontSampleEl.style.fontFamily,
+ this.setUpFontSample_(fontSampleEl, size, fontSampleEl.style.fontFamily,
true);
fontSampleEl = $('serif-font-sample');
- this.setUpFontSample_(fontSampleEl, value, fontSampleEl.style.fontFamily,
+ this.setUpFontSample_(fontSampleEl, size, fontSampleEl.style.fontFamily,
true);
fontSampleEl = $('sans-serif-font-sample');
- this.setUpFontSample_(fontSampleEl, value, fontSampleEl.style.fontFamily,
+ this.setUpFontSample_(fontSampleEl, size, fontSampleEl.style.fontFamily,
true);
fontSampleEl = $('fixed-font-sample');
this.setUpFontSample_(fontSampleEl,
- value - OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD,
+ size - OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD,
fontSampleEl.style.fontFamily, false);
},
@@ -108,10 +108,10 @@ cr.define('options', function() {
* @private
*/
standardFontSizeChanged_: function(event) {
- var value = this.mapValueToRange(this.value);
+ var size = this.mapPositionToPref(this.value);
Preferences.setIntegerPref(
'webkit.webprefs.default_fixed_font_size',
- value - OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD, true);
+ size - OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD, true);
return false;
},
@@ -124,9 +124,9 @@ cr.define('options', function() {
* @private
*/
minimumRangeChanged_: function(el, event) {
- var value = el.mapValueToRange(el.value);
+ var size = el.mapPositionToPref(el.value);
var fontSampleEl = $('minimum-font-sample');
- this.setUpFontSample_(fontSampleEl, value, fontSampleEl.style.fontFamily,
+ this.setUpFontSample_(fontSampleEl, size, fontSampleEl.style.fontFamily,
true);
},
@@ -137,9 +137,9 @@ cr.define('options', function() {
* @private
*/
minimumFontSizeChanged_: function(event) {
- var value = this.mapValueToRange(this.value);
+ var size = this.mapPositionToPref(this.value);
Preferences.setIntegerPref(
- 'webkit.webprefs.minimum_logical_font_size', value, true);
+ 'webkit.webprefs.minimum_logical_font_size', size, true);
return false;
},
« no previous file with comments | « no previous file | chrome/browser/resources/options/pref_ui.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698