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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // Query the initial state. | 123 // Query the initial state. |
124 cr.sendWithPromise('getResetThemeEnabled').then( | 124 cr.sendWithPromise('getResetThemeEnabled').then( |
125 this.setResetThemeEnabled.bind(this)); | 125 this.setResetThemeEnabled.bind(this)); |
126 | 126 |
127 // Set up the change event listener. | 127 // Set up the change event listener. |
128 cr.addWebUIListener('reset-theme-enabled-changed', | 128 cr.addWebUIListener('reset-theme-enabled-changed', |
129 this.setResetThemeEnabled.bind(this)); | 129 this.setResetThemeEnabled.bind(this)); |
130 }, | 130 }, |
131 | 131 |
132 /** | 132 /** |
| 133 * @param {boolean} isNtp Whether to use the NTP as the home page. |
| 134 * @param {string} homepage If not using NTP, use this URL. |
| 135 * @return {string} The sub-label. |
| 136 * @private |
| 137 */ |
| 138 getShowHomeSubLabel_: function(isNtp, homepage) { |
| 139 if (isNtp) |
| 140 return this.i18n('homePageNtp'); |
| 141 return homepage || this.i18n('exampleDotCom'); |
| 142 }, |
| 143 |
| 144 /** |
133 * @param {boolean} enabled Whether the theme reset is available. | 145 * @param {boolean} enabled Whether the theme reset is available. |
134 */ | 146 */ |
135 setResetThemeEnabled: function(enabled) { | 147 setResetThemeEnabled: function(enabled) { |
136 this.allowResetTheme_ = enabled; | 148 this.allowResetTheme_ = enabled; |
137 }, | 149 }, |
138 | 150 |
139 /** @private */ | 151 /** @private */ |
140 onCustomizeFontsTap_: function() { | 152 onCustomizeFontsTap_: function() { |
141 this.$.pages.setSubpageChain(['appearance-fonts']); | 153 this.$.pages.setSubpageChain(['appearance-fonts']); |
142 }, | 154 }, |
(...skipping 25 matching lines...) Expand all Loading... |
168 * @param {number} percent The integer percentage of the page zoom. | 180 * @param {number} percent The integer percentage of the page zoom. |
169 * @private | 181 * @private |
170 */ | 182 */ |
171 zoomLevelChanged_: function(percent) { | 183 zoomLevelChanged_: function(percent) { |
172 // The |percent| may be undefined on startup. | 184 // The |percent| may be undefined on startup. |
173 if (percent === undefined) | 185 if (percent === undefined) |
174 return; | 186 return; |
175 chrome.settingsPrivate.setDefaultZoomPercent(percent); | 187 chrome.settingsPrivate.setDefaultZoomPercent(percent); |
176 }, | 188 }, |
177 }); | 189 }); |
OLD | NEW |