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

Side by Side Diff: chrome/browser/resources/options/pref_ui.js

Issue 6110006: give tabbed options clear browsing dialog a facelift (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: delete bugs Created 9 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/options/options.js ('k') | 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 cr.define('options', function() { 5 cr.define('options', function() {
6 6
7 var Preferences = options.Preferences; 7 var Preferences = options.Preferences;
8 ///////////////////////////////////////////////////////////////////////////// 8 /////////////////////////////////////////////////////////////////////////////
9 // PrefCheckbox class: 9 // PrefCheckbox class:
10 // TODO(jhawkins): Refactor all this copy-pasted code! 10 // TODO(jhawkins): Refactor all this copy-pasted code!
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 updateIndicator: function() { 273 updateIndicator: function() {
274 if ($(this.id + '-value')) { 274 if ($(this.id + '-value')) {
275 $(this.id + '-value').textContent = this.value; 275 $(this.id + '-value').textContent = this.value;
276 } 276 }
277 } 277 }
278 }; 278 };
279 279
280 ///////////////////////////////////////////////////////////////////////////// 280 /////////////////////////////////////////////////////////////////////////////
281 // PrefSelect class: 281 // PrefSelect class:
282 282
283 // Define a constructor that uses an select element as its underlying element. 283 // Define a constructor that uses a select element as its underlying element.
284 var PrefSelect = cr.ui.define('select'); 284 var PrefSelect = cr.ui.define('select');
285 285
286 PrefSelect.prototype = { 286 PrefSelect.prototype = {
287 // Set up the prototype chain 287 // Set up the prototype chain
288 __proto__: HTMLSelectElement.prototype, 288 __proto__: HTMLSelectElement.prototype,
289 289
290 /** 290 /**
291 * Initialization function for the cr.ui framework. 291 * Initialization function for the cr.ui framework.
292 */ 292 */
293 decorate: function() { 293 decorate: function() {
(...skipping 30 matching lines...) Expand all
324 if (!found) 324 if (!found)
325 self.selectedIndex = 0; 325 self.selectedIndex = 0;
326 326
327 if (self.onchange != undefined) 327 if (self.onchange != undefined)
328 self.onchange(event); 328 self.onchange(event);
329 }); 329 });
330 330
331 // Listen to user events. 331 // Listen to user events.
332 this.addEventListener('change', 332 this.addEventListener('change',
333 function(e) { 333 function(e) {
334 if (!self.dataType)
335 console.error('unknown data type for <select> pref');
336
334 switch(self.dataType) { 337 switch(self.dataType) {
335 case 'number': 338 case 'number':
336 Preferences.setIntegerPref(self.pref, 339 Preferences.setIntegerPref(self.pref,
337 self.options[self.selectedIndex].value, self.metric); 340 self.options[self.selectedIndex].value, self.metric);
338 break; 341 break;
339 case 'boolean': 342 case 'boolean':
340 var option = self.options[self.selectedIndex]; 343 var option = self.options[self.selectedIndex];
341 var value = (option.value == 'true') ? true : false; 344 var value = (option.value == 'true') ? true : false;
342 Preferences.setBooleanPref(self.pref, value, self.metric); 345 Preferences.setBooleanPref(self.pref, value, self.metric);
343 break; 346 break;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 PrefCheckbox: PrefCheckbox, 427 PrefCheckbox: PrefCheckbox,
425 PrefNumber: PrefNumber, 428 PrefNumber: PrefNumber,
426 PrefNumeric: PrefNumeric, 429 PrefNumeric: PrefNumeric,
427 PrefRadio: PrefRadio, 430 PrefRadio: PrefRadio,
428 PrefRange: PrefRange, 431 PrefRange: PrefRange,
429 PrefSelect: PrefSelect, 432 PrefSelect: PrefSelect,
430 PrefTextField: PrefTextField 433 PrefTextField: PrefTextField
431 }; 434 };
432 435
433 }); 436 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/options.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698