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

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

Issue 2773233002: MD Settings: change settings-input to home-url-input due to reduced usage. (Closed)
Patch Set: updates based on comments Created 3 years, 8 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 return [ 45 return [
46 {value: 9, name: loadTimeData.getString('verySmall')}, 46 {value: 9, name: loadTimeData.getString('verySmall')},
47 {value: 12, name: loadTimeData.getString('small')}, 47 {value: 12, name: loadTimeData.getString('small')},
48 {value: 16, name: loadTimeData.getString('medium')}, 48 {value: 16, name: loadTimeData.getString('medium')},
49 {value: 20, name: loadTimeData.getString('large')}, 49 {value: 20, name: loadTimeData.getString('large')},
50 {value: 24, name: loadTimeData.getString('veryLarge')}, 50 {value: 24, name: loadTimeData.getString('veryLarge')},
51 ]; 51 ];
52 }, 52 },
53 }, 53 },
54 54
55 /** @private */
56 isHomeUrlInvalid_: Boolean,
57
58 /** 55 /**
59 * List of options for the page zoom drop-down menu. 56 * List of options for the page zoom drop-down menu.
60 * @type {!Array<number>} 57 * @type {!Array<number>}
61 */ 58 */
62 pageZoomLevels_: { 59 pageZoomLevels_: {
63 readOnly: true, 60 readOnly: true,
64 type: Array, 61 type: Array,
65 value: [ 62 value: [
66 // TODO(dbeam): get these dynamically from C++ instead. 63 // TODO(dbeam): get these dynamically from C++ instead.
67 1 / 4, 64 1 / 4,
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 /** 265 /**
269 * @see content::ZoomValuesEqual(). 266 * @see content::ZoomValuesEqual().
270 * @param {number} zoom1 267 * @param {number} zoom1
271 * @param {number} zoom2 268 * @param {number} zoom2
272 * @return {boolean} 269 * @return {boolean}
273 * @private 270 * @private
274 */ 271 */
275 zoomValuesEqual_: function(zoom1, zoom2) { 272 zoomValuesEqual_: function(zoom1, zoom2) {
276 return Math.abs(zoom1 - zoom2) <= 0.001; 273 return Math.abs(zoom1 - zoom2) <= 0.001;
277 }, 274 },
278
279 /**
280 * @param {!Event} event
281 * @private
282 */
283 validate_: function(event) {
284 var inputElement = Polymer.dom(event).localTarget;
285
286 if (inputElement.value == '') {
287 this.isHomeUrlInvalid_ = false;
288 return;
289 }
290
291 this.browserProxy_.validateStartupPage(inputElement.value)
292 .then(function(isValid) {
293 this.isHomeUrlInvalid_ = !isValid;
294 }.bind(this));
295 },
296 }); 275 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698