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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 value = value != this.numericUncheckedValue; | 117 value = value != this.numericUncheckedValue; |
118 | 118 |
119 return this.inverted ? !value : !!value; | 119 return this.inverted ? !value : !!value; |
120 }, | 120 }, |
121 | 121 |
122 /** | 122 /** |
123 * @return {boolean} Whether the checkbox should be disabled. | 123 * @return {boolean} Whether the checkbox should be disabled. |
124 * @private | 124 * @private |
125 */ | 125 */ |
126 controlDisabled_: function() { | 126 controlDisabled_: function() { |
127 return this.disabled || this.isPrefPolicyControlled(); | 127 return this.disabled || this.isPrefEnforced(); |
128 }, | 128 }, |
129 }; | 129 }; |
130 | 130 |
131 /** @polymerBehavior */ | 131 /** @polymerBehavior */ |
132 var SettingsBooleanControlBehavior = [ | 132 var SettingsBooleanControlBehavior = [ |
133 CrPolicyPrefBehavior, | 133 CrPolicyPrefBehavior, |
134 PrefControlBehavior, | 134 PrefControlBehavior, |
135 SettingsBooleanControlBehaviorImpl, | 135 SettingsBooleanControlBehaviorImpl, |
136 ]; | 136 ]; |
OLD | NEW |