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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 /** @override */ | 133 /** @override */ |
134 created: function() { | 134 created: function() { |
135 this.browserProxy_ = settings.AppearanceBrowserProxyImpl.getInstance(); | 135 this.browserProxy_ = settings.AppearanceBrowserProxyImpl.getInstance(); |
136 }, | 136 }, |
137 | 137 |
138 /** @override */ | 138 /** @override */ |
139 ready: function() { | 139 ready: function() { |
140 this.$.defaultFontSize.menuOptions = this.fontSizeOptions_; | 140 this.$.defaultFontSize.menuOptions = this.fontSizeOptions_; |
141 // TODO(dschuyler): Look into adding a listener for the | 141 // TODO(dschuyler): Look into adding a listener for the |
142 // default zoom percent. | 142 // default zoom percent. |
143 this.browserProxy_.getDefaultZoom().then(function(zoom) { | 143 this.browserProxy_.getDefaultZoom().then(zoom => { |
144 this.defaultZoom_ = zoom; | 144 this.defaultZoom_ = zoom; |
145 }.bind(this)); | 145 }); |
146 }, | 146 }, |
147 | 147 |
148 /** | 148 /** |
149 * @param {number} zoom | 149 * @param {number} zoom |
150 * @return {number} A zoom easier read by users. | 150 * @return {number} A zoom easier read by users. |
151 * @private | 151 * @private |
152 */ | 152 */ |
153 formatZoom_: function(zoom) { | 153 formatZoom_: function(zoom) { |
154 return Math.round(zoom * 100); | 154 return Math.round(zoom * 100); |
155 }, | 155 }, |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 | 264 |
265 /** | 265 /** |
266 * @param {string} themeId | 266 * @param {string} themeId |
267 * @param {boolean} useSystemTheme | 267 * @param {boolean} useSystemTheme |
268 * @private | 268 * @private |
269 */ | 269 */ |
270 themeChanged_: function(themeId, useSystemTheme) { | 270 themeChanged_: function(themeId, useSystemTheme) { |
271 if (themeId) { | 271 if (themeId) { |
272 assert(!useSystemTheme); | 272 assert(!useSystemTheme); |
273 | 273 |
274 this.browserProxy_.getThemeInfo(themeId).then(function(info) { | 274 this.browserProxy_.getThemeInfo(themeId).then(info => { |
275 this.themeSublabel_ = info.name; | 275 this.themeSublabel_ = info.name; |
276 }.bind(this)); | 276 }); |
277 | 277 |
278 this.themeUrl_ = 'https://chrome.google.com/webstore/detail/' + themeId; | 278 this.themeUrl_ = 'https://chrome.google.com/webstore/detail/' + themeId; |
279 return; | 279 return; |
280 } | 280 } |
281 | 281 |
282 var i18nId; | 282 var i18nId; |
283 // <if expr="is_linux and not chromeos"> | 283 // <if expr="is_linux and not chromeos"> |
284 i18nId = useSystemTheme ? 'systemTheme' : 'classicTheme'; | 284 i18nId = useSystemTheme ? 'systemTheme' : 'classicTheme'; |
285 // </if> | 285 // </if> |
286 // <if expr="not is_linux or chromeos"> | 286 // <if expr="not is_linux or chromeos"> |
(...skipping 21 matching lines...) Expand all Loading... |
308 * @see content::ZoomValuesEqual(). | 308 * @see content::ZoomValuesEqual(). |
309 * @param {number} zoom1 | 309 * @param {number} zoom1 |
310 * @param {number} zoom2 | 310 * @param {number} zoom2 |
311 * @return {boolean} | 311 * @return {boolean} |
312 * @private | 312 * @private |
313 */ | 313 */ |
314 zoomValuesEqual_: function(zoom1, zoom2) { | 314 zoomValuesEqual_: function(zoom1, zoom2) { |
315 return Math.abs(zoom1 - zoom2) <= 0.001; | 315 return Math.abs(zoom1 - zoom2) <= 0.001; |
316 }, | 316 }, |
317 }); | 317 }); |
OLD | NEW |