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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 }, | 44 }, |
45 | 45 |
46 /** | 46 /** |
47 * Clears the preference associated with this indicator. | 47 * Clears the preference associated with this indicator. |
48 * @private | 48 * @private |
49 */ | 49 */ |
50 clearAssociatedPref_: function() { | 50 clearAssociatedPref_: function() { |
51 Preferences.clearPref(this.pref, !this.dialogPref); | 51 Preferences.clearPref(this.pref, !this.dialogPref); |
52 }, | 52 }, |
53 | 53 |
54 /* Handle changes to the associated pref by hiding any currently visible | 54 /** |
| 55 * Handle changes to the associated pref by hiding any currently visible |
55 * bubble and updating the controlledBy property. | 56 * bubble and updating the controlledBy property. |
56 * @param {Event} event Pref change event. | 57 * @param {Event} event Pref change event. |
57 */ | 58 */ |
58 handlePrefChange: function(event) { | 59 handlePrefChange: function(event) { |
59 PageManager.hideBubble(); | 60 PageManager.hideBubble(); |
60 if (event.value.controlledBy) { | 61 if (event.value.controlledBy) { |
61 if (!this.value || String(event.value.value) == this.value) { | 62 if (!this.value || String(event.value.value) == this.value) { |
62 this.controlledBy = event.value.controlledBy; | 63 this.controlledBy = event.value.controlledBy; |
63 if (event.value.extension) { | 64 if (event.value.extension) { |
64 this.extensionId = event.value.extension.id; | 65 this.extensionId = event.value.extension.id; |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 * @type {string} | 229 * @type {string} |
229 */ | 230 */ |
230 cr.defineProperty(ControlledSettingIndicator, 'controlledBy', | 231 cr.defineProperty(ControlledSettingIndicator, 'controlledBy', |
231 cr.PropertyKind.ATTR); | 232 cr.PropertyKind.ATTR); |
232 | 233 |
233 // Export. | 234 // Export. |
234 return { | 235 return { |
235 ControlledSettingIndicator: ControlledSettingIndicator | 236 ControlledSettingIndicator: ControlledSettingIndicator |
236 }; | 237 }; |
237 }); | 238 }); |
OLD | NEW |