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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 /** | 54 /** |
55 * Handle changes to the associated pref by hiding any currently visible | 55 * Handle changes to the associated pref by hiding any currently visible |
56 * bubble and updating the controlledBy property. | 56 * bubble and updating the controlledBy property. |
57 * @param {Event} event Pref change event. | 57 * @param {Event} event Pref change event. |
58 * @suppress {checkTypes} | |
59 * TODO(vitalyp): remove the suppression. | |
Dan Beam
2014/10/01 23:25:45
why?
Vitaly Pavlenko
2014/10/01 23:38:17
this.controlledBy defined as cr.defineProperty(),
| |
58 */ | 60 */ |
59 handlePrefChange: function(event) { | 61 handlePrefChange: function(event) { |
60 PageManager.hideBubble(); | 62 PageManager.hideBubble(); |
61 if (event.value.controlledBy) { | 63 if (event.value.controlledBy) { |
62 if (!this.value || String(event.value.value) == this.value) { | 64 if (!this.value || String(event.value.value) == this.value) { |
63 this.controlledBy = event.value.controlledBy; | 65 this.controlledBy = event.value.controlledBy; |
64 if (event.value.extension) { | 66 if (event.value.extension) { |
65 this.extensionId = event.value.extension.id; | 67 this.extensionId = event.value.extension.id; |
66 this.extensionIcon = event.value.extension.icon; | 68 this.extensionIcon = event.value.extension.icon; |
67 this.extensionName = event.value.extension.name; | 69 this.extensionName = event.value.extension.name; |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 * - unset: The value is controlled by the user alone. | 228 * - unset: The value is controlled by the user alone. |
227 */ | 229 */ |
228 cr.defineProperty(ControlledSettingIndicator, 'controlledBy', | 230 cr.defineProperty(ControlledSettingIndicator, 'controlledBy', |
229 cr.PropertyKind.ATTR); | 231 cr.PropertyKind.ATTR); |
230 | 232 |
231 // Export. | 233 // Export. |
232 return { | 234 return { |
233 ControlledSettingIndicator: ControlledSettingIndicator | 235 ControlledSettingIndicator: ControlledSettingIndicator |
234 }; | 236 }; |
235 }); | 237 }); |
OLD | NEW |