| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 * @fileoverview | 6 * @fileoverview |
| 7 * A behavior to help controls that handle a boolean preference, such as | 7 * A behavior to help controls that handle a boolean preference, such as |
| 8 * checkbox and toggle button. | 8 * checkbox and toggle button. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 }, | 56 }, |
| 57 | 57 |
| 58 /** | 58 /** |
| 59 * For numeric prefs only, the integer value equivalent to the unchecked | 59 * For numeric prefs only, the integer value equivalent to the unchecked |
| 60 * state. This is the value sent to prefs if the user unchecks the control. | 60 * state. This is the value sent to prefs if the user unchecks the control. |
| 61 * During initialization, the control is unchecked if and only if the pref | 61 * During initialization, the control is unchecked if and only if the pref |
| 62 * value is equal to the this value. (Values 2, 3, 4, etc. all are checked.) | 62 * value is equal to the this value. (Values 2, 3, 4, etc. all are checked.) |
| 63 */ | 63 */ |
| 64 numericUncheckedValue: { | 64 numericUncheckedValue: { |
| 65 type: Number, | 65 type: Number, |
| 66 readOnly: true, | |
| 67 value: 0, | 66 value: 0, |
| 68 } | 67 } |
| 69 }, | 68 }, |
| 70 | 69 |
| 71 observers: [ | 70 observers: [ |
| 72 'prefValueChanged_(pref.value)', | 71 'prefValueChanged_(pref.value)', |
| 73 ], | 72 ], |
| 74 | 73 |
| 75 notifyChangedByUserInteraction: function() { | 74 notifyChangedByUserInteraction: function() { |
| 76 this.fire('settings-boolean-control-change'); | 75 this.fire('settings-boolean-control-change'); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 return this.disabled || this.isPrefEnforced(); | 128 return this.disabled || this.isPrefEnforced(); |
| 130 }, | 129 }, |
| 131 }; | 130 }; |
| 132 | 131 |
| 133 /** @polymerBehavior */ | 132 /** @polymerBehavior */ |
| 134 var SettingsBooleanControlBehavior = [ | 133 var SettingsBooleanControlBehavior = [ |
| 135 CrPolicyPrefBehavior, | 134 CrPolicyPrefBehavior, |
| 136 PrefControlBehavior, | 135 PrefControlBehavior, |
| 137 SettingsBooleanControlBehaviorImpl, | 136 SettingsBooleanControlBehaviorImpl, |
| 138 ]; | 137 ]; |
| OLD | NEW |