| 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 * 'settings-appearance-page' is the settings page containing appearance | 6 * 'settings-appearance-page' is the settings page containing appearance |
| 7 * settings. | 7 * settings. |
| 8 * | 8 * |
| 9 * Example: | 9 * Example: |
| 10 * | 10 * |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 /** | 122 /** |
| 123 * @param {number} zoom | 123 * @param {number} zoom |
| 124 * @return {number} A zoom easier read by users. | 124 * @return {number} A zoom easier read by users. |
| 125 * @private | 125 * @private |
| 126 */ | 126 */ |
| 127 formatZoom_: function(zoom) { | 127 formatZoom_: function(zoom) { |
| 128 return Math.round(zoom * 100); | 128 return Math.round(zoom * 100); |
| 129 }, | 129 }, |
| 130 | 130 |
| 131 /** | 131 /** |
| 132 * @param {boolean} showHomepage Whether to show home page. |
| 132 * @param {boolean} isNtp Whether to use the NTP as the home page. | 133 * @param {boolean} isNtp Whether to use the NTP as the home page. |
| 133 * @param {string} homepage If not using NTP, use this URL. | 134 * @param {string} homepageValue If not using NTP, use this URL. |
| 134 * @return {string} The sub-label. | 135 * @return {string} The sub-label. |
| 135 * @private | 136 * @private |
| 136 */ | 137 */ |
| 137 getShowHomeSubLabel_: function(isNtp, homepage) { | 138 getShowHomeSubLabel_: function(showHomepage, isNtp, homepageValue) { |
| 139 if (!showHomepage) |
| 140 return this.i18n('homeButtonDisabled'); |
| 138 if (isNtp) | 141 if (isNtp) |
| 139 return this.i18n('homePageNtp'); | 142 return this.i18n('homePageNtp'); |
| 140 return homepage || this.i18n('exampleDotCom'); | 143 return homepageValue || this.i18n('customWebAddress'); |
| 141 }, | 144 }, |
| 142 | 145 |
| 143 /** @private */ | 146 /** @private */ |
| 144 onCustomizeFontsTap_: function() { | 147 onCustomizeFontsTap_: function() { |
| 145 settings.navigateTo(settings.Route.FONTS); | 148 settings.navigateTo(settings.Route.FONTS); |
| 146 }, | 149 }, |
| 147 | 150 |
| 148 /** @private */ | 151 /** @private */ |
| 149 onDisableExtension_: function() { | 152 onDisableExtension_: function() { |
| 150 this.fire('refresh-pref', 'homepage'); | 153 this.fire('refresh-pref', 'homepage'); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 * @see content::ZoomValuesEqual(). | 266 * @see content::ZoomValuesEqual(). |
| 264 * @param {number} zoom1 | 267 * @param {number} zoom1 |
| 265 * @param {number} zoom2 | 268 * @param {number} zoom2 |
| 266 * @return {boolean} | 269 * @return {boolean} |
| 267 * @private | 270 * @private |
| 268 */ | 271 */ |
| 269 zoomValuesEqual_: function(zoom1, zoom2) { | 272 zoomValuesEqual_: function(zoom1, zoom2) { |
| 270 return Math.abs(zoom1 - zoom2) <= 0.001; | 273 return Math.abs(zoom1 - zoom2) <= 0.001; |
| 271 }, | 274 }, |
| 272 }); | 275 }); |
| OLD | NEW |