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

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

Issue 2403353002: MD Settings: Stop calling chrome.settingsPrivate.setDefaultZoomLevel on startup. (Closed)
Patch Set: Nit. Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 /** 43 /**
44 * @private 44 * @private
45 */ 45 */
46 defaultZoomLevel_: { 46 defaultZoomLevel_: {
47 notify: true, 47 notify: true,
48 type: Object, 48 type: Object,
49 value: function() { 49 value: function() {
50 return { 50 return {
51 type: chrome.settingsPrivate.PrefType.NUMBER, 51 type: chrome.settingsPrivate.PrefType.NUMBER,
52 /* Needed such that the pref can be initialized without unnecessarily
53 * invoking chrome.settingsPrivate.setDefaultZoomPercent(). */
54 initialized: false,
michaelpg 2016/10/11 03:47:33 We probably shouldn't "overload" this value more t
dpapad 2016/10/11 17:30:17 Done.
52 }; 55 };
53 }, 56 },
54 }, 57 },
55 58
56 /** 59 /**
57 * List of options for the font size drop-down menu. 60 * List of options for the font size drop-down menu.
58 * @type {!DropdownMenuOptionList} 61 * @type {!DropdownMenuOptionList}
59 */ 62 */
60 fontSizeOptions_: { 63 fontSizeOptions_: {
61 readOnly: true, 64 readOnly: true,
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 }, 209 },
207 210
208 /** 211 /**
209 * @param {number} percent The integer percentage of the page zoom. 212 * @param {number} percent The integer percentage of the page zoom.
210 * @private 213 * @private
211 */ 214 */
212 zoomLevelChanged_: function(percent) { 215 zoomLevelChanged_: function(percent) {
213 // The |percent| may be undefined on startup. 216 // The |percent| may be undefined on startup.
214 if (percent === undefined) 217 if (percent === undefined)
215 return; 218 return;
219
220 if (!this.defaultZoomLevel_.initialized) {
michaelpg 2016/10/11 03:47:33 Since we only use this here, I wouldn't be averse
dpapad 2016/10/11 17:30:17 What do you mean defining it only here? Here in th
michaelpg 2016/10/11 22:01:10 Oh, I was just saying, this is JS, we don't have t
dpapad 2016/10/11 22:05:54 Ah, got it now. Personally I don't prefer augmenti
221 // Simply mark this pref as initialized, no actual change was requested by
222 // the user.
223 this.defaultZoomLevel_.initialized = true;
224 return;
225 }
226
216 chrome.settingsPrivate.setDefaultZoomPercent(percent); 227 chrome.settingsPrivate.setDefaultZoomPercent(percent);
217 }, 228 },
218 229
219 /** 230 /**
220 * @param {boolean} bookmarksBarVisible if bookmarks bar option is visible. 231 * @param {boolean} bookmarksBarVisible if bookmarks bar option is visible.
221 * @return {string} 'first' if the argument is false or empty otherwise. 232 * @return {string} 'first' if the argument is false or empty otherwise.
222 * @private 233 * @private
223 */ 234 */
224 getFirst_: function(bookmarksBarVisible) { 235 getFirst_: function(bookmarksBarVisible) {
225 return !bookmarksBarVisible ? 'first' : ''; 236 return !bookmarksBarVisible ? 'first' : '';
226 } 237 }
227 }); 238 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698