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

Side by Side Diff: chrome/browser/resources/settings/appearance_page/appearance_page.js

Issue 1798133002: [MD settings] add sub-label to Show Home Button check box (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: closure fix Created 4 years, 9 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 unified diff | Download patch
OLDNEW
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
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 * @private {string} The sub-label.
dpapad 2016/03/14 21:33:26 Did you mean this? * @return {string} The sub-lab
dschuyler 2016/03/14 22:42:24 Thanks!
136 */
137 getShowHomeSubLabel_: function(isNtp, homepage) {
138 if (isNtp)
139 return this.i18n('homePageNtp');
140 if (homepage.length == 0)
141 return this.i18n('exampleDotCom');
142 return homepage;
143 },
144
145 /**
133 * @param {boolean} enabled Whether the theme reset is available. 146 * @param {boolean} enabled Whether the theme reset is available.
134 */ 147 */
135 setResetThemeEnabled: function(enabled) { 148 setResetThemeEnabled: function(enabled) {
136 this.allowResetTheme_ = enabled; 149 this.allowResetTheme_ = enabled;
137 }, 150 },
138 151
139 /** @private */ 152 /** @private */
140 onCustomizeFontsTap_: function() { 153 onCustomizeFontsTap_: function() {
141 this.$.pages.setSubpageChain(['appearance-fonts']); 154 this.$.pages.setSubpageChain(['appearance-fonts']);
142 }, 155 },
(...skipping 25 matching lines...) Expand all
168 * @param {number} percent The integer percentage of the page zoom. 181 * @param {number} percent The integer percentage of the page zoom.
169 * @private 182 * @private
170 */ 183 */
171 zoomLevelChanged_: function(percent) { 184 zoomLevelChanged_: function(percent) {
172 // The |percent| may be undefined on startup. 185 // The |percent| may be undefined on startup.
173 if (percent === undefined) 186 if (percent === undefined)
174 return; 187 return;
175 chrome.settingsPrivate.setDefaultZoomPercent(percent); 188 chrome.settingsPrivate.setDefaultZoomPercent(percent);
176 }, 189 },
177 }); 190 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698