| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 Polymer element for indicating policies based on network | 6 * @fileoverview Polymer element for indicating policies based on network |
| 7 * properties. | 7 * properties. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 Polymer({ | 10 Polymer({ |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 var effective = property.Effective; | 44 var effective = property.Effective; |
| 45 var active = property.Active; | 45 var active = property.Active; |
| 46 if (active == undefined) | 46 if (active == undefined) |
| 47 active = property[effective]; | 47 active = property[effective]; |
| 48 | 48 |
| 49 if (property.UserEditable === true && | 49 if (property.UserEditable === true && |
| 50 property.hasOwnProperty('UserPolicy')) { | 50 property.hasOwnProperty('UserPolicy')) { |
| 51 // We ignore UserEditable unless there is a UserPolicy. | 51 // We ignore UserEditable unless there is a UserPolicy. |
| 52 this.indicatorType = CrPolicyIndicatorType.RECOMMENDED; | 52 this.indicatorType = CrPolicyIndicatorType.RECOMMENDED; |
| 53 this.recommended = | 53 this.recommended = |
| 54 /** @type {CrOnc.NetworkPropertyType} */(property.UserPolicy); | 54 /** @type {CrOnc.NetworkPropertyType} */ (property.UserPolicy); |
| 55 } else if (property.DeviceEditable === true && | 55 } else if ( |
| 56 property.hasOwnProperty('DevicePolicy')) { | 56 property.DeviceEditable === true && |
| 57 property.hasOwnProperty('DevicePolicy')) { |
| 57 // We ignore DeviceEditable unless there is a DevicePolicy. | 58 // We ignore DeviceEditable unless there is a DevicePolicy. |
| 58 this.indicatorType = CrPolicyIndicatorType.RECOMMENDED; | 59 this.indicatorType = CrPolicyIndicatorType.RECOMMENDED; |
| 59 this.recommended = | 60 this.recommended = |
| 60 /** @type {CrOnc.NetworkPropertyType} */(property.DevicePolicy); | 61 /** @type {CrOnc.NetworkPropertyType} */ (property.DevicePolicy); |
| 61 } else if (effective == 'UserPolicy') { | 62 } else if (effective == 'UserPolicy') { |
| 62 this.indicatorType = CrPolicyIndicatorType.USER_POLICY; | 63 this.indicatorType = CrPolicyIndicatorType.USER_POLICY; |
| 63 } else if (effective == 'DevicePolicy') { | 64 } else if (effective == 'DevicePolicy') { |
| 64 this.indicatorType = CrPolicyIndicatorType.DEVICE_POLICY; | 65 this.indicatorType = CrPolicyIndicatorType.DEVICE_POLICY; |
| 65 } else if (effective == 'ActiveExtension') { | 66 } else if (effective == 'ActiveExtension') { |
| 66 this.indicatorType = CrPolicyIndicatorType.EXTENSION; | 67 this.indicatorType = CrPolicyIndicatorType.EXTENSION; |
| 67 } else { | 68 } else { |
| 68 this.indicatorType = CrPolicyIndicatorType.NONE; | 69 this.indicatorType = CrPolicyIndicatorType.NONE; |
| 69 } | 70 } |
| 70 }, | 71 }, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 83 var value = property.Active; | 84 var value = property.Active; |
| 84 if (value == undefined && property.Effective) | 85 if (value == undefined && property.Effective) |
| 85 value = property[property.Effective]; | 86 value = property[property.Effective]; |
| 86 if (value == recommended) | 87 if (value == recommended) |
| 87 return this.i18n_('controlledSettingRecommendedMatches'); | 88 return this.i18n_('controlledSettingRecommendedMatches'); |
| 88 return this.i18n_('controlledSettingRecommendedDiffers'); | 89 return this.i18n_('controlledSettingRecommendedDiffers'); |
| 89 } | 90 } |
| 90 return this.getPolicyIndicatorTooltip(type, ''); | 91 return this.getPolicyIndicatorTooltip(type, ''); |
| 91 } | 92 } |
| 92 }); | 93 }); |
| OLD | NEW |