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 | 5 |
6 /** | 6 /** |
7 * This is the absolute difference maintained between standard and | 7 * This is the absolute difference maintained between standard and |
8 * fixed-width font sizes. http://crbug.com/91922. | 8 * fixed-width font sizes. http://crbug.com/91922. |
9 * @const @private {number} | 9 * @const @private {number} |
10 */ | 10 */ |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 3, | 87 3, |
88 4, | 88 4, |
89 5, | 89 5, |
90 ], | 90 ], |
91 }, | 91 }, |
92 | 92 |
93 /** @private */ | 93 /** @private */ |
94 themeSublabel_: String, | 94 themeSublabel_: String, |
95 | 95 |
96 /** @private */ | 96 /** @private */ |
| 97 themeUrl_: String, |
| 98 |
| 99 /** @private */ |
97 useSystemTheme_: { | 100 useSystemTheme_: { |
98 type: Boolean, | 101 type: Boolean, |
99 value: false, // Can only be true on Linux, but value exists everywhere. | 102 value: false, // Can only be true on Linux, but value exists everywhere. |
100 }, | 103 }, |
101 | 104 |
102 /** @private {!Map<string, string>} */ | 105 /** @private {!Map<string, string>} */ |
103 focusConfig_: { | 106 focusConfig_: { |
104 type: Object, | 107 type: Object, |
105 value: function() { | 108 value: function() { |
106 var map = new Map(); | 109 var map = new Map(); |
107 map.set( | 110 map.set( |
108 settings.Route.FONTS.path, | 111 settings.Route.FONTS.path, |
109 '#customize-fonts-subpage-trigger .subpage-arrow'); | 112 '#customize-fonts-subpage-trigger .subpage-arrow'); |
110 return map; | 113 return map; |
111 }, | 114 }, |
112 }, | 115 }, |
113 }, | 116 }, |
114 | 117 |
115 /** @private {?settings.AppearanceBrowserProxy} */ | 118 /** @private {?settings.AppearanceBrowserProxy} */ |
116 browserProxy_: null, | 119 browserProxy_: null, |
117 | 120 |
118 /** @private {string} */ | |
119 themeUrl_: '', | |
120 | |
121 observers: [ | 121 observers: [ |
122 'defaultFontSizeChanged_(prefs.webkit.webprefs.default_font_size.value)', | 122 'defaultFontSizeChanged_(prefs.webkit.webprefs.default_font_size.value)', |
123 'themeChanged_(prefs.extensions.theme.id.value, useSystemTheme_)', | 123 'themeChanged_(prefs.extensions.theme.id.value, useSystemTheme_)', |
124 | 124 |
125 // <if expr="is_linux and not chromeos"> | 125 // <if expr="is_linux and not chromeos"> |
126 // NOTE: this pref only exists on Linux. | 126 // NOTE: this pref only exists on Linux. |
127 'useSystemThemePrefChanged_(prefs.extensions.theme.use_system.value)', | 127 'useSystemThemePrefChanged_(prefs.extensions.theme.use_system.value)', |
128 // </if> | 128 // </if> |
129 ], | 129 ], |
130 | 130 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 * @private | 180 * @private |
181 */ | 181 */ |
182 defaultFontSizeChanged_: function(value) { | 182 defaultFontSizeChanged_: function(value) { |
183 // This pref is handled separately in some extensions, but here it is tied | 183 // This pref is handled separately in some extensions, but here it is tied |
184 // to default_font_size (to simplify the UI). | 184 // to default_font_size (to simplify the UI). |
185 this.set( | 185 this.set( |
186 'prefs.webkit.webprefs.default_fixed_font_size.value', | 186 'prefs.webkit.webprefs.default_fixed_font_size.value', |
187 value - SIZE_DIFFERENCE_FIXED_STANDARD_); | 187 value - SIZE_DIFFERENCE_FIXED_STANDARD_); |
188 }, | 188 }, |
189 | 189 |
190 /** @private */ | 190 /** |
191 onThemesTap_: function() { | 191 * URL for either current theme or the theme gallery. |
192 window.open(this.themeUrl_ || loadTimeData.getString('themesGalleryUrl')); | 192 * @return {string} |
| 193 * @private |
| 194 */ |
| 195 getThemeHref_: function() { |
| 196 return this.themeUrl_ || loadTimeData.getString('themesGalleryUrl'); |
193 }, | 197 }, |
194 | 198 |
195 // <if expr="chromeos"> | 199 // <if expr="chromeos"> |
196 /** | 200 /** |
197 * ChromeOS only. | 201 * ChromeOS only. |
198 * @private | 202 * @private |
199 */ | 203 */ |
200 openWallpaperManager_: function() { | 204 openWallpaperManager_: function() { |
201 this.browserProxy_.openWallpaperManager(); | 205 this.browserProxy_.openWallpaperManager(); |
202 }, | 206 }, |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 * @see content::ZoomValuesEqual(). | 304 * @see content::ZoomValuesEqual(). |
301 * @param {number} zoom1 | 305 * @param {number} zoom1 |
302 * @param {number} zoom2 | 306 * @param {number} zoom2 |
303 * @return {boolean} | 307 * @return {boolean} |
304 * @private | 308 * @private |
305 */ | 309 */ |
306 zoomValuesEqual_: function(zoom1, zoom2) { | 310 zoomValuesEqual_: function(zoom1, zoom2) { |
307 return Math.abs(zoom1 - zoom2) <= 0.001; | 311 return Math.abs(zoom1 - zoom2) <= 0.001; |
308 }, | 312 }, |
309 }); | 313 }); |
OLD | NEW |