| 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 Behavior for policy controlled indicators. | 6 * @fileoverview Behavior for policy controlled indicators. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Strings required for policy indicators. These must be set at runtime. | 10 * Strings required for policy indicators. These must be set at runtime. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 case CrPolicyIndicatorType.RECOMMENDED: | 64 case CrPolicyIndicatorType.RECOMMENDED: |
| 65 icon = 'cr20:domain'; | 65 icon = 'cr20:domain'; |
| 66 break; | 66 break; |
| 67 default: | 67 default: |
| 68 assertNotReached(); | 68 assertNotReached(); |
| 69 } | 69 } |
| 70 return icon; | 70 return icon; |
| 71 }, | 71 }, |
| 72 | 72 |
| 73 /** | 73 /** |
| 74 * @param {CrPolicyIndicatorType} type | 74 * @param {!CrPolicyIndicatorType} type |
| 75 * @param {string} name The name associated with the indicator. See | 75 * @param {string} name The name associated with the indicator. See |
| 76 * chrome.settingsPrivate.PrefObject.controlledByName | 76 * chrome.settingsPrivate.PrefObject.controlledByName |
| 77 * @param {boolean=} opt_matches For RECOMMENDED only, whether the indicator | 77 * @param {boolean=} opt_matches For RECOMMENDED only, whether the indicator |
| 78 * value matches the recommended value. | 78 * value matches the recommended value. |
| 79 * @return {string} The tooltip text for |type|. | 79 * @return {string} The tooltip text for |type|. |
| 80 */ | 80 */ |
| 81 getPolicyIndicatorTooltip: function(type, name, opt_matches) { | 81 getPolicyIndicatorTooltip: function(type, name, opt_matches) { |
| 82 if (!CrPolicyStrings) | 82 if (!CrPolicyStrings) |
| 83 return ''; // Tooltips may not be defined, e.g. in OOBE. | 83 return ''; // Tooltips may not be defined, e.g. in OOBE. |
| 84 switch (type) { | 84 switch (type) { |
| 85 case CrPolicyIndicatorType.PRIMARY_USER: | 85 case CrPolicyIndicatorType.PRIMARY_USER: |
| 86 return CrPolicyStrings.controlledSettingShared.replace('$1', name); | 86 return CrPolicyStrings.controlledSettingShared.replace('$1', name); |
| 87 case CrPolicyIndicatorType.OWNER: | 87 case CrPolicyIndicatorType.OWNER: |
| 88 return CrPolicyStrings.controlledSettingOwner.replace('$1', name); | 88 return CrPolicyStrings.controlledSettingOwner.replace('$1', name); |
| 89 case CrPolicyIndicatorType.USER_POLICY: | 89 case CrPolicyIndicatorType.USER_POLICY: |
| 90 case CrPolicyIndicatorType.DEVICE_POLICY: | 90 case CrPolicyIndicatorType.DEVICE_POLICY: |
| 91 return CrPolicyStrings.controlledSettingPolicy; | 91 return CrPolicyStrings.controlledSettingPolicy; |
| 92 case CrPolicyIndicatorType.RECOMMENDED: | 92 case CrPolicyIndicatorType.RECOMMENDED: |
| 93 return opt_matches ? | 93 return opt_matches ? |
| 94 CrPolicyStrings.controlledSettingRecommendedMatches : | 94 CrPolicyStrings.controlledSettingRecommendedMatches : |
| 95 CrPolicyStrings.controlledSettingRecommendedDiffers; | 95 CrPolicyStrings.controlledSettingRecommendedDiffers; |
| 96 } | 96 } |
| 97 return ''; | 97 return ''; |
| 98 }, | 98 }, |
| 99 }; | 99 }; |
| OLD | NEW |