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

Side by Side Diff: chrome/browser/resources/settings/appearance_page/appearance_fonts_page.js

Issue 2738333004: [MD settings] set pref to valid slider value (Closed)
Patch Set: quotes Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 })();
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698