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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 PageManager.hideBubble(); | 60 PageManager.hideBubble(); |
61 if (event.value.controlledBy) { | 61 if (event.value.controlledBy) { |
62 if (!this.value || String(event.value.value) == this.value) { | 62 if (!this.value || String(event.value.value) == this.value) { |
63 this.controlledBy = event.value.controlledBy; | 63 this.controlledBy = event.value.controlledBy; |
64 if (event.value.extension) { | 64 if (event.value.extension) { |
65 this.extensionId = event.value.extension.id; | 65 this.extensionId = event.value.extension.id; |
66 this.extensionIcon = event.value.extension.icon; | 66 this.extensionIcon = event.value.extension.icon; |
67 this.extensionName = event.value.extension.name; | 67 this.extensionName = event.value.extension.name; |
68 } | 68 } |
69 } else { | 69 } else { |
70 this.controlledBy = null; | 70 this.controlledBy = ''; |
71 } | 71 } |
72 } else if (event.value.recommendedValue != undefined) { | 72 } else if (event.value.recommendedValue != undefined) { |
73 this.controlledBy = | 73 this.controlledBy = |
74 !this.value || String(event.value.recommendedValue) == this.value ? | 74 !this.value || String(event.value.recommendedValue) == this.value ? |
75 'hasRecommendation' : null; | 75 'hasRecommendation' : ''; |
Dan Beam
2014/09/11 02:53:09
nit: indent + 4\s more
Vitaly Pavlenko
2014/09/11 04:16:25
This way?
| |
76 } else { | 76 } else { |
77 this.controlledBy = null; | 77 this.controlledBy = ''; |
78 } | 78 } |
79 }, | 79 }, |
80 | 80 |
81 /** | 81 /** |
82 * Open or close a bubble with further information about the pref. | 82 * Open or close a bubble with further information about the pref. |
83 * @override | 83 * @override |
84 */ | 84 */ |
85 toggleBubble: function() { | 85 toggleBubble: function() { |
86 if (this.showingBubble) { | 86 if (this.showingBubble) { |
87 PageManager.hideBubble(); | 87 PageManager.hideBubble(); |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 * - unset: The value is controlled by the user alone. | 226 * - unset: The value is controlled by the user alone. |
227 */ | 227 */ |
228 cr.defineProperty(ControlledSettingIndicator, 'controlledBy', | 228 cr.defineProperty(ControlledSettingIndicator, 'controlledBy', |
229 cr.PropertyKind.ATTR); | 229 cr.PropertyKind.ATTR); |
230 | 230 |
231 // Export. | 231 // Export. |
232 return { | 232 return { |
233 ControlledSettingIndicator: ControlledSettingIndicator | 233 ControlledSettingIndicator: ControlledSettingIndicator |
234 }; | 234 }; |
235 }); | 235 }); |
OLD | NEW |