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 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** | 8 /** |
9 * A lookup helper function to find the first node that has an id (starting | 9 * A lookup helper function to find the first node that has an id (starting |
10 * at |node| and going up the parent chain). | 10 * at |node| and going up the parent chain). |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 if (extension.wantsFileAccess) { | 143 if (extension.wantsFileAccess) { |
144 var fileAccess = node.querySelector('.file-access-control'); | 144 var fileAccess = node.querySelector('.file-access-control'); |
145 fileAccess.addEventListener('click', function(e) { | 145 fileAccess.addEventListener('click', function(e) { |
146 chrome.send('extensionSettingsAllowFileAccess', | 146 chrome.send('extensionSettingsAllowFileAccess', |
147 [extension.id, String(e.target.checked)]); | 147 [extension.id, String(e.target.checked)]); |
148 }); | 148 }); |
149 fileAccess.querySelector('input').checked = extension.allowFileAccess; | 149 fileAccess.querySelector('input').checked = extension.allowFileAccess; |
150 fileAccess.hidden = false; | 150 fileAccess.hidden = false; |
151 } | 151 } |
152 | 152 |
153 // The 'Options' checkbox. | 153 // The 'Options' link. |
154 if (extension.enabled && extension.optionsUrl) { | 154 if (extension.enabled && extension.optionsUrl) { |
155 var options = node.querySelector('.options-link'); | 155 var options = node.querySelector('.options-link'); |
156 options.addEventListener('click', function(e) { | 156 options.addEventListener('click', function(e) { |
157 chrome.send('extensionSettingsOptions', [extension.id]); | 157 chrome.send('extensionSettingsOptions', [extension.id]); |
158 e.preventDefault(); | 158 e.preventDefault(); |
159 }); | 159 }); |
160 options.hidden = false; | 160 options.hidden = false; |
161 } | 161 } |
162 | 162 |
| 163 // The 'Permissions' link. |
| 164 var permissions = node.querySelector('.permissions-link'); |
| 165 permissions.addEventListener('click', function(e) { |
| 166 chrome.send('extensionSettingsPermissions', [extension.id]); |
| 167 e.preventDefault(); |
| 168 }); |
| 169 |
163 if (extension.allow_activity) { | 170 if (extension.allow_activity) { |
164 var activity = node.querySelector('.activity-link'); | 171 var activity = node.querySelector('.activity-link'); |
165 activity.addEventListener('click', function(e) { | 172 activity.addEventListener('click', function(e) { |
166 chrome.send('navigateToUrl', [ | 173 chrome.send('navigateToUrl', [ |
167 'chrome://extension-activity?extensionId=' + extension.id, | 174 'chrome://extension-activity?extensionId=' + extension.id, |
168 '_blank', | 175 '_blank', |
169 e.button, | 176 e.button, |
170 e.altKey, | 177 e.altKey, |
171 e.ctrlKey, | 178 e.ctrlKey, |
172 e.metaKey, | 179 e.metaKey, |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 } | 328 } |
322 | 329 |
323 this.appendChild(node); | 330 this.appendChild(node); |
324 } | 331 } |
325 }; | 332 }; |
326 | 333 |
327 return { | 334 return { |
328 ExtensionsList: ExtensionsList | 335 ExtensionsList: ExtensionsList |
329 }; | 336 }; |
330 }); | 337 }); |
OLD | NEW |