| 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 Polymer({ | 5 Polymer({ |
| 6 is: 'controlled-button', | 6 is: 'controlled-button', |
| 7 | 7 |
| 8 behaviors: [ | 8 behaviors: [ |
| 9 CrPolicyIndicatorBehavior, | 9 CrPolicyIndicatorBehavior, |
| 10 CrPolicyPrefBehavior, | 10 CrPolicyPrefBehavior, |
| 11 PrefControlBehavior, | 11 PrefControlBehavior, |
| 12 ], | 12 ], |
| 13 | 13 |
| 14 properties: { | 14 properties: { |
| 15 endJustified: { |
| 16 type: Boolean, |
| 17 value: false, |
| 18 reflectToAttribute: true, |
| 19 }, |
| 20 |
| 15 /** @private */ | 21 /** @private */ |
| 16 controlled_: { | 22 controlled_: { |
| 17 type: Boolean, | 23 type: Boolean, |
| 18 computed: 'computeControlled_(pref.*)', | 24 computed: 'computeControlled_(pref.*)', |
| 19 reflectToAttribute: true, | 25 reflectToAttribute: true, |
| 20 }, | 26 }, |
| 21 }, | 27 }, |
| 22 | 28 |
| 23 /** | 29 /** |
| 24 * @return {boolean} Whether the button is disabled. | 30 * @return {boolean} Whether the button is disabled. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 43 * @return {boolean} Whether to show a controlled by indicator. | 49 * @return {boolean} Whether to show a controlled by indicator. |
| 44 * @private | 50 * @private |
| 45 */ | 51 */ |
| 46 showIndicator_: function(pref) { | 52 showIndicator_: function(pref) { |
| 47 if (!pref.controlledBy || !pref.enforcement) | 53 if (!pref.controlledBy || !pref.enforcement) |
| 48 return false; | 54 return false; |
| 49 var indicator = this.getIndicatorType(pref.controlledBy, pref.enforcement); | 55 var indicator = this.getIndicatorType(pref.controlledBy, pref.enforcement); |
| 50 return this.isIndicatorVisible(indicator); | 56 return this.isIndicatorVisible(indicator); |
| 51 }, | 57 }, |
| 52 }); | 58 }); |
| OLD | NEW |