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 <include src="extension_error.js"></include> | 5 <include src="extension_error.js"></include> |
6 | 6 |
7 cr.define('options', function() { | 7 cr.define('options', function() { |
8 'use strict'; | 8 'use strict'; |
9 | 9 |
10 /** | 10 /** |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 var checked = e.target.checked; | 141 var checked = e.target.checked; |
142 butterBarVisibility[extension.id] = checked; | 142 butterBarVisibility[extension.id] = checked; |
143 butterBar.hidden = !checked || extension.is_hosted_app; | 143 butterBar.hidden = !checked || extension.is_hosted_app; |
144 chrome.send('extensionSettingsEnableIncognito', | 144 chrome.send('extensionSettingsEnableIncognito', |
145 [extension.id, String(checked)]); | 145 [extension.id, String(checked)]); |
146 }); | 146 }); |
147 } | 147 } |
148 var butterBar = node.querySelector('.butter-bar'); | 148 var butterBar = node.querySelector('.butter-bar'); |
149 butterBar.hidden = !butterBarVisibility[extension.id]; | 149 butterBar.hidden = !butterBarVisibility[extension.id]; |
150 | 150 |
| 151 // The 'collect errors' checkbox. This should only be visible if the |
| 152 // error console is enabled - we can detect this by the existence of the |
| 153 // |errorCollectionEnabled| property. |
| 154 if (extension.wantsErrorCollection) { |
| 155 node.querySelector('.error-collection-control').hidden = false; |
| 156 var errorCollection = |
| 157 node.querySelector('.error-collection-control input'); |
| 158 errorCollection.checked = extension.errorCollectionEnabled; |
| 159 errorCollection.addEventListener('change', function(e) { |
| 160 chrome.send('extensionSettingsEnableErrorCollection', |
| 161 [extension.id, String(e.target.checked)]); |
| 162 }); |
| 163 } |
| 164 |
151 // The 'allow file:// access' checkbox. | 165 // The 'allow file:// access' checkbox. |
152 if (extension.wantsFileAccess) { | 166 if (extension.wantsFileAccess) { |
153 var fileAccess = node.querySelector('.file-access-control'); | 167 var fileAccess = node.querySelector('.file-access-control'); |
154 fileAccess.addEventListener('click', function(e) { | 168 fileAccess.addEventListener('click', function(e) { |
155 chrome.send('extensionSettingsAllowFileAccess', | 169 chrome.send('extensionSettingsAllowFileAccess', |
156 [extension.id, String(e.target.checked)]); | 170 [extension.id, String(e.target.checked)]); |
157 }); | 171 }); |
158 fileAccess.querySelector('input').checked = extension.allowFileAccess; | 172 fileAccess.querySelector('input').checked = extension.allowFileAccess; |
159 fileAccess.hidden = false; | 173 fileAccess.hidden = false; |
160 } | 174 } |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 topScroll -= pad / 2; | 365 topScroll -= pad / 2; |
352 setScrollTopForDocument(document, topScroll); | 366 setScrollTopForDocument(document, topScroll); |
353 } | 367 } |
354 }, | 368 }, |
355 }; | 369 }; |
356 | 370 |
357 return { | 371 return { |
358 ExtensionsList: ExtensionsList | 372 ExtensionsList: ExtensionsList |
359 }; | 373 }; |
360 }); | 374 }); |
OLD | NEW |