| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.define('options', function() { | 5 cr.define('options', function() { |
| 6 var Preferences = options.Preferences; | 6 var Preferences = options.Preferences; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * A controlled setting indicator that can be placed on a setting as an | 9 * A controlled setting indicator that can be placed on a setting as an |
| 10 * indicator that the value is controlled by some external entity such as | 10 * indicator that the value is controlled by some external entity such as |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 'extensionWithName': loadTimeData.getString( | 112 'extensionWithName': loadTimeData.getString( |
| 113 'controlledSettingExtensionWithName'), | 113 'controlledSettingExtensionWithName'), |
| 114 'recommended': | 114 'recommended': |
| 115 loadTimeData.getString('controlledSettingRecommended'), | 115 loadTimeData.getString('controlledSettingRecommended'), |
| 116 'hasRecommendation': | 116 'hasRecommendation': |
| 117 loadTimeData.getString('controlledSettingHasRecommendation'), | 117 loadTimeData.getString('controlledSettingHasRecommendation'), |
| 118 }; | 118 }; |
| 119 if (cr.isChromeOS) { | 119 if (cr.isChromeOS) { |
| 120 defaultStrings.owner = | 120 defaultStrings.owner = |
| 121 loadTimeData.getString('controlledSettingOwner'); | 121 loadTimeData.getString('controlledSettingOwner'); |
| 122 defaultStrings.shared = |
| 123 loadTimeData.getString('controlledSettingShared'); |
| 122 } | 124 } |
| 123 } | 125 } |
| 124 | 126 |
| 125 // No controller, no bubble. | 127 // No controller, no bubble. |
| 126 if (!this.controlledBy || !(this.controlledBy in defaultStrings)) | 128 if (!this.controlledBy || !(this.controlledBy in defaultStrings)) |
| 127 return; | 129 return; |
| 128 | 130 |
| 129 var text = defaultStrings[this.controlledBy]; | 131 var text = defaultStrings[this.controlledBy]; |
| 130 if (this.controlledBy == 'extension' && this.extensionName) | 132 if (this.controlledBy == 'extension' && this.extensionName) |
| 131 text = defaultStrings.extensionWithName; | 133 text = defaultStrings.extensionWithName; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 cr.PropertyKind.ATTR); | 216 cr.PropertyKind.ATTR); |
| 215 | 217 |
| 216 /** | 218 /** |
| 217 * The status of the associated preference: | 219 * The status of the associated preference: |
| 218 * - 'policy': A specific value is enfoced by policy. | 220 * - 'policy': A specific value is enfoced by policy. |
| 219 * - 'extension': A specific value is enforced by an extension. | 221 * - 'extension': A specific value is enforced by an extension. |
| 220 * - 'recommended': A value is recommended by policy. The user could | 222 * - 'recommended': A value is recommended by policy. The user could |
| 221 * override this recommendation but has not done so. | 223 * override this recommendation but has not done so. |
| 222 * - 'hasRecommendation': A value is recommended by policy. The user has | 224 * - 'hasRecommendation': A value is recommended by policy. The user has |
| 223 * overridden this recommendation. | 225 * overridden this recommendation. |
| 226 * - 'owner': A value is controlled by the owner of the device |
| 227 * (Chrome OS only). |
| 228 * - 'shared': A value belongs to the primary user but can be |
| 229 * modified (Chrome OS only). |
| 224 * - unset: The value is controlled by the user alone. | 230 * - unset: The value is controlled by the user alone. |
| 225 * @type {string} | 231 * @type {string} |
| 226 */ | 232 */ |
| 227 cr.defineProperty(ControlledSettingIndicator, 'controlledBy', | 233 cr.defineProperty(ControlledSettingIndicator, 'controlledBy', |
| 228 cr.PropertyKind.ATTR); | 234 cr.PropertyKind.ATTR); |
| 229 | 235 |
| 230 // Export. | 236 // Export. |
| 231 return { | 237 return { |
| 232 ControlledSettingIndicator: ControlledSettingIndicator | 238 ControlledSettingIndicator: ControlledSettingIndicator |
| 233 }; | 239 }; |
| 234 }); | 240 }); |
| OLD | NEW |