| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // TODO(jhawkins): Add dialog-pref support to all preference controls. | 5 // TODO(jhawkins): Add dialog-pref support to all preference controls. |
| 6 | 6 |
| 7 cr.define('options', function() { | 7 cr.define('options', function() { |
| 8 | 8 |
| 9 var Preferences = options.Preferences; | 9 var Preferences = options.Preferences; |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 function updateElementState_(el, event) { | 50 function updateElementState_(el, event) { |
| 51 el.controlledBy = null; | 51 el.controlledBy = null; |
| 52 | 52 |
| 53 if (!event.value) | 53 if (!event.value) |
| 54 return; | 54 return; |
| 55 | 55 |
| 56 updateDisabledState_(el, 'notUserModifiable', event.value.disabled); | 56 updateDisabledState_(el, 'notUserModifiable', event.value.disabled); |
| 57 | 57 |
| 58 el.controlledBy = event.value['controlledBy']; | 58 el.controlledBy = event.value['controlledBy']; |
| 59 | 59 |
| 60 BrowserOptions.updateManagedBannerVisibility(); | 60 OptionsPage.updateManagedBannerVisibility(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 ///////////////////////////////////////////////////////////////////////////// | 63 ///////////////////////////////////////////////////////////////////////////// |
| 64 // PrefCheckbox class: | 64 // PrefCheckbox class: |
| 65 // TODO(jhawkins): Refactor all this copy-pasted code! | 65 // TODO(jhawkins): Refactor all this copy-pasted code! |
| 66 | 66 |
| 67 // Define a constructor that uses an input element as its underlying element. | 67 // Define a constructor that uses an input element as its underlying element. |
| 68 var PrefCheckbox = cr.ui.define('input'); | 68 var PrefCheckbox = cr.ui.define('input'); |
| 69 | 69 |
| 70 PrefCheckbox.prototype = { | 70 PrefCheckbox.prototype = { |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 * @type {string} The stored value of the preference that this text field | 615 * @type {string} The stored value of the preference that this text field |
| 616 * controls. | 616 * controls. |
| 617 */ | 617 */ |
| 618 prefValue_: null, | 618 prefValue_: null, |
| 619 | 619 |
| 620 /** | 620 /** |
| 621 * Saves the value of the input back into the preference. May be called | 621 * Saves the value of the input back into the preference. May be called |
| 622 * directly to save dialog preferences. | 622 * directly to save dialog preferences. |
| 623 */ | 623 */ |
| 624 savePrefState: function() { | 624 savePrefState: function() { |
| 625 switch(this.dataType) { | 625 switch (this.dataType) { |
| 626 case 'number': | 626 case 'number': |
| 627 Preferences.setIntegerPref(this.pref, this.value, this.metric); | 627 Preferences.setIntegerPref(this.pref, this.value, this.metric); |
| 628 break; | 628 break; |
| 629 case 'double': | 629 case 'double': |
| 630 Preferences.setDoublePref(this.pref, this.value, this.metric); | 630 Preferences.setDoublePref(this.pref, this.value, this.metric); |
| 631 break; | 631 break; |
| 632 case 'url': | 632 case 'url': |
| 633 Preferences.setURLPref(this.pref, this.value, this.metric); | 633 Preferences.setURLPref(this.pref, this.value, this.metric); |
| 634 break; | 634 break; |
| 635 default: | 635 default: |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 PrefNumber: PrefNumber, | 774 PrefNumber: PrefNumber, |
| 775 PrefNumeric: PrefNumeric, | 775 PrefNumeric: PrefNumeric, |
| 776 PrefRadio: PrefRadio, | 776 PrefRadio: PrefRadio, |
| 777 PrefRange: PrefRange, | 777 PrefRange: PrefRange, |
| 778 PrefSelect: PrefSelect, | 778 PrefSelect: PrefSelect, |
| 779 PrefTextField: PrefTextField, | 779 PrefTextField: PrefTextField, |
| 780 PrefButton: PrefButton | 780 PrefButton: PrefButton |
| 781 }; | 781 }; |
| 782 | 782 |
| 783 }); | 783 }); |
| OLD | NEW |