| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 (function() { | 5 (function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * This is the absolute difference maintained between standard and | 9 * This is the absolute difference maintained between standard and |
| 10 * fixed-width font sizes. http://crbug.com/91922. | 10 * fixed-width font sizes. http://crbug.com/91922. |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 */ | 149 */ |
| 150 fontSizeChanged_: function(value) { | 150 fontSizeChanged_: function(value) { |
| 151 // TODO(michaelpg): Whitelist this pref in prefs_utils.cc so it is | 151 // TODO(michaelpg): Whitelist this pref in prefs_utils.cc so it is |
| 152 // included in the <settings-prefs> getAllPrefs call, otherwise this path | 152 // included in the <settings-prefs> getAllPrefs call, otherwise this path |
| 153 // is invalid and nothing happens. See crbug.com/612535. | 153 // is invalid and nothing happens. See crbug.com/612535. |
| 154 this.set('prefs.webkit.webprefs.default_fixed_font_size.value', | 154 this.set('prefs.webkit.webprefs.default_fixed_font_size.value', |
| 155 value - SIZE_DIFFERENCE_FIXED_STANDARD_); | 155 value - SIZE_DIFFERENCE_FIXED_STANDARD_); |
| 156 }, | 156 }, |
| 157 | 157 |
| 158 /** | 158 /** |
| 159 * Creates an html style value. | 159 * Get the minimum font size, accounting for unset prefs. |
| 160 * @param {number} fontSize The font size to use. | 160 * @return {?} |
| 161 * @param {string} fontFamily The name of the font family use. | |
| 162 * @return {string} | |
| 163 * @private | 161 * @private |
| 164 */ | 162 */ |
| 165 computeStyle_: function(fontSize, fontFamily) { | 163 computeMinimumFontSize_: function() { |
| 166 return 'font-size: ' + fontSize + "px; font-family: '" + fontFamily + | 164 return this.get('prefs.webkit.webprefs.minimum_font_size.value') || |
| 167 "';"; | 165 MINIMUM_FONT_SIZE_RANGE_[0]; |
| 168 }, | 166 }, |
| 169 }); | 167 }); |
| 170 })(); | 168 })(); |
| OLD | NEW |