| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 Polymer({ |
| 6 is: 'controlled-button', |
| 7 |
| 8 behaviors: [CrPolicyPrefBehavior, PrefControlBehavior], |
| 9 |
| 10 properties: { |
| 11 /** @private */ |
| 12 controlled_: { |
| 13 type: Boolean, |
| 14 computed: 'computeControlled_(pref)', |
| 15 reflectToAttribute: true, |
| 16 }, |
| 17 }, |
| 18 |
| 19 /** |
| 20 * @param {!chrome.settingsPrivate.PrefObject} pref |
| 21 * @return {boolean} Whether the button is disabled. |
| 22 * @private |
| 23 */ |
| 24 computeControlled_: function(pref) { |
| 25 return this.isPrefPolicyControlled(pref); |
| 26 }, |
| 27 |
| 28 /** |
| 29 * @param {!Event} e |
| 30 * @private |
| 31 */ |
| 32 onIndicatorTap_: function(e) { |
| 33 // Disallow <controlled-button on-tap="..."> when controlled. |
| 34 e.preventDefault(); |
| 35 e.stopPropagation(); |
| 36 }, |
| 37 }); |
| OLD | NEW |