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

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

Issue 2817243003: [MD settings] observe changes to default font size in Appearance (Closed)
Patch Set: nits Created 3 years, 8 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 | « chrome/browser/resources/settings/appearance_page/appearance_page.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/appearance_page/appearance_page.js
diff --git a/chrome/browser/resources/settings/appearance_page/appearance_page.js b/chrome/browser/resources/settings/appearance_page/appearance_page.js
index 9039741b3736e81b204bfe2cd4a79ab3e86168c7..5571b2d249929d5d2f22da0ac953f2ef182dc7fd 100644
--- a/chrome/browser/resources/settings/appearance_page/appearance_page.js
+++ b/chrome/browser/resources/settings/appearance_page/appearance_page.js
@@ -2,6 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+
+/**
+ * This is the absolute difference maintained between standard and
+ * fixed-width font sizes. http://crbug.com/91922.
+ * @const @private {number}
+ */
+var SIZE_DIFFERENCE_FIXED_STANDARD_ = 3;
+
+
/**
* 'settings-appearance-page' is the settings page containing appearance
* settings.
@@ -110,12 +119,13 @@ Polymer({
themeUrl_: '',
observers: [
+ 'defaultFontSizeChanged_(prefs.webkit.webprefs.default_font_size.value)',
'themeChanged_(prefs.extensions.theme.id.value, useSystemTheme_)',
-// <if expr="is_linux and not chromeos">
+ // <if expr="is_linux and not chromeos">
// NOTE: this pref only exists on Linux.
'useSystemThemePrefChanged_(prefs.extensions.theme.use_system.value)',
-// </if>
+ // </if>
],
created: function() {
@@ -165,6 +175,18 @@ Polymer({
this.fire('refresh-pref', 'homepage');
},
+ /**
+ * @param {number} value The changed font size slider value.
+ * @private
+ */
+ defaultFontSizeChanged_: function(value) {
+ // This pref is handled separately in some extensions, but here it is tied
+ // to default_font_size (to simplify the UI).
+ this.set(
+ 'prefs.webkit.webprefs.default_fixed_font_size.value',
+ value - SIZE_DIFFERENCE_FIXED_STANDARD_);
+ },
+
/** @private */
onThemesTap_: function() {
window.open(this.themeUrl_ || loadTimeData.getString('themesGalleryUrl'));
@@ -250,12 +272,12 @@ Polymer({
}
var i18nId;
-// <if expr="is_linux and not chromeos">
+ // <if expr="is_linux and not chromeos">
i18nId = useSystemTheme ? 'systemTheme' : 'classicTheme';
-// </if>
-// <if expr="not is_linux or chromeos">
+ // </if>
+ // <if expr="not is_linux or chromeos">
i18nId = 'chooseFromWebStore';
-// </if>
+ // </if>
this.themeSublabel_ = this.i18n(i18nId);
this.themeUrl_ = '';
},
« no previous file with comments | « chrome/browser/resources/settings/appearance_page/appearance_page.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698