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

Unified Diff: chrome/browser/resources/settings/appearance_page/appearance_fonts_page.js

Issue 2738333004: [MD settings] set pref to valid slider value (Closed)
Patch Set: min font size 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/appearance_page/appearance_fonts_page.js
diff --git a/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.js b/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.js
index 17d826a81fed428b956b7e2cb4960f367716a12a..a0f50aa0ea3ac94c04ca95dd8ff4eebd2912f4d4 100644
--- a/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.js
+++ b/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.js
@@ -156,7 +156,29 @@
},
/**
- * Creates an html style value.
+ * Get the minimum font size, accounting for unset prefs.
+ * @return {string}
+ * @private
+ */
+ computeMinimumFontSize_: function() {
+ var value = this.get('prefs.webkit.webprefs.minimum_font_size.value');
+ return (value ? value : MINIMUM_FONT_SIZE_RANGE_[0]).toString();
Dan Beam 2017/03/14 03:27:19 (value || MINIMUM_FONT_SIZE_RANGE_[0]) why toStri
dschuyler 2017/03/14 18:55:31 Done.
+ },
+
+ /**
+ * Creates an html style value for the minimum font size.
+ * @param {number} fontSize The font size to use.
+ * @param {string} fontFamily The name of the font family use.
+ * @return {string}
+ * @private
+ */
+ computeMinimumStyle_: function(fontSize, fontFamily) {
+ return 'font-size: ' + this.computeMinimumFontSize_() +
+ "px; font-family: '" + fontFamily + "';";
+ },
+
+ /**
+ * Creates an html style value for the default font size.
* @param {number} fontSize The font size to use.
* @param {string} fontFamily The name of the font family use.
* @return {string}

Powered by Google App Engine
This is Rietveld 408576698