OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 cr.define('options', function() { | 5 cr.define('options', function() { |
6 | 6 |
7 var OptionsPage = options.OptionsPage; | 7 var OptionsPage = options.OptionsPage; |
8 | 8 |
9 /** | 9 /** |
10 * FontSettings class | 10 * FontSettings class |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 /** | 102 /** |
103 * Sets the 'default_fixed_font_size' preference when the standard font | 103 * Sets the 'default_fixed_font_size' preference when the standard font |
104 * size has been changed by the user. | 104 * size has been changed by the user. |
105 * @param {Element} el The slider input element. | 105 * @param {Element} el The slider input element. |
106 * @param {number} value The mapped value that has been saved. | 106 * @param {number} value The mapped value that has been saved. |
107 * @private | 107 * @private |
108 */ | 108 */ |
109 standardFontSizeChanged_: function(el, value) { | 109 standardFontSizeChanged_: function(el, value) { |
110 Preferences.setIntegerPref( | 110 Preferences.setIntegerPref( |
111 'webkit.webprefs.global.default_fixed_font_size', | 111 'webkit.webprefs.default_fixed_font_size', |
112 value - OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD, ''); | 112 value - OptionsPage.SIZE_DIFFERENCE_FIXED_STANDARD, ''); |
113 }, | 113 }, |
114 | 114 |
115 /** | 115 /** |
116 * Called as the user changes the miniumum font size. This allows for | 116 * Called as the user changes the miniumum font size. This allows for |
117 * reflecting the change in the UI before the preference has been changed. | 117 * reflecting the change in the UI before the preference has been changed. |
118 * @param {Element} el The slider input element. | 118 * @param {Element} el The slider input element. |
119 * @param {number} value The mapped value currently set by the slider. | 119 * @param {number} value The mapped value currently set by the slider. |
120 * @private | 120 * @private |
121 */ | 121 */ |
122 minimumRangeChanged_: function(el, value) { | 122 minimumRangeChanged_: function(el, value) { |
123 var fontSampleEl = $('minimum-font-sample'); | 123 var fontSampleEl = $('minimum-font-sample'); |
124 this.setUpFontSample_(fontSampleEl, value, fontSampleEl.style.fontFamily, | 124 this.setUpFontSample_(fontSampleEl, value, fontSampleEl.style.fontFamily, |
125 true); | 125 true); |
126 }, | 126 }, |
127 | 127 |
128 /** | 128 /** |
129 * Sets the 'minimum_logical_font_size' preference when the minimum font | 129 * Sets the 'minimum_logical_font_size' preference when the minimum font |
130 * size has been changed by the user. | 130 * size has been changed by the user. |
131 * @param {Element} el The slider input element. | 131 * @param {Element} el The slider input element. |
132 * @param {number} value The mapped value that has been saved. | 132 * @param {number} value The mapped value that has been saved. |
133 * @private | 133 * @private |
134 */ | 134 */ |
135 minimumFontSizeChanged_: function(el, value) { | 135 minimumFontSizeChanged_: function(el, value) { |
136 Preferences.setIntegerPref( | 136 Preferences.setIntegerPref( |
137 'webkit.webprefs.global.minimum_logical_font_size', value, ''); | 137 'webkit.webprefs.minimum_logical_font_size', value, ''); |
138 }, | 138 }, |
139 | 139 |
140 /** | 140 /** |
141 * Sets the text, font size and font family of the sample text. | 141 * Sets the text, font size and font family of the sample text. |
142 * @param {Element} el The div containing the sample text. | 142 * @param {Element} el The div containing the sample text. |
143 * @param {number} size The font size of the sample text. | 143 * @param {number} size The font size of the sample text. |
144 * @param {string} font The font family of the sample text. | 144 * @param {string} font The font family of the sample text. |
145 * @param {bool} showSize True if the font size should appear in the sample. | 145 * @param {bool} showSize True if the font size should appear in the sample. |
146 * @private | 146 * @private |
147 */ | 147 */ |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 FontSettings.getInstance().setUpFontSample_($('minimum-font-sample'), size, | 227 FontSettings.getInstance().setUpFontSample_($('minimum-font-sample'), size, |
228 null, true); | 228 null, true); |
229 }; | 229 }; |
230 | 230 |
231 // Export | 231 // Export |
232 return { | 232 return { |
233 FontSettings: FontSettings | 233 FontSettings: FontSettings |
234 }; | 234 }; |
235 }); | 235 }); |
236 | 236 |
OLD | NEW |