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' link. | 153 // The 'Options' checkbox. |
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 | |
170 if (extension.allow_activity) { | 163 if (extension.allow_activity) { |
171 var activity = node.querySelector('.activity-link'); | 164 var activity = node.querySelector('.activity-link'); |
172 activity.addEventListener('click', function(e) { | 165 activity.addEventListener('click', function(e) { |
173 chrome.send('navigateToUrl', [ | 166 chrome.send('navigateToUrl', [ |
174 'chrome://extension-activity?extensionId=' + extension.id, | 167 'chrome://extension-activity?extensionId=' + extension.id, |
175 '_blank', | 168 '_blank', |
176 e.button, | 169 e.button, |
177 e.altKey, | 170 e.altKey, |
178 e.ctrlKey, | 171 e.ctrlKey, |
179 e.metaKey, | 172 e.metaKey, |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 } | 321 } |
329 | 322 |
330 this.appendChild(node); | 323 this.appendChild(node); |
331 } | 324 } |
332 }; | 325 }; |
333 | 326 |
334 return { | 327 return { |
335 ExtensionsList: ExtensionsList | 328 ExtensionsList: ExtensionsList |
336 }; | 329 }; |
337 }); | 330 }); |
OLD | NEW |