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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 options.hidden = false; | 157 options.hidden = false; |
158 } | 158 } |
159 | 159 |
160 // The 'Permissions' link. | 160 // The 'Permissions' link. |
161 var permissions = node.querySelector('.permissions-link'); | 161 var permissions = node.querySelector('.permissions-link'); |
162 permissions.addEventListener('click', function(e) { | 162 permissions.addEventListener('click', function(e) { |
163 chrome.send('extensionSettingsPermissions', [extension.id]); | 163 chrome.send('extensionSettingsPermissions', [extension.id]); |
164 e.preventDefault(); | 164 e.preventDefault(); |
165 }); | 165 }); |
166 | 166 |
167 if (extension.allow_activity) { | |
168 var activity = node.querySelector('.activity-link'); | |
169 activity.addEventListener('click', function(e) { | |
170 chrome.send('navigateToUrl', [ | |
171 'chrome://extension-activity?extensionId=' + extension.id, | |
172 '_blank', | |
173 e.button, | |
174 e.altKey, | |
175 e.ctrlKey, | |
176 e.metaKey, | |
177 e.shiftKey | |
178 ]); | |
179 e.preventDefault(); | |
180 }); | |
181 activity.hidden = false; | |
182 } | |
183 | |
184 // The 'View in Web Store/View Web Site' link. | 167 // The 'View in Web Store/View Web Site' link. |
185 if (extension.homepageUrl) { | 168 if (extension.homepageUrl) { |
186 var siteLink = node.querySelector('.site-link'); | 169 var siteLink = node.querySelector('.site-link'); |
187 siteLink.href = extension.homepageUrl; | 170 siteLink.href = extension.homepageUrl; |
188 siteLink.textContent = loadTimeData.getString( | 171 siteLink.textContent = loadTimeData.getString( |
189 extension.homepageProvided ? 'extensionSettingsVisitWebsite' : | 172 extension.homepageProvided ? 'extensionSettingsVisitWebsite' : |
190 'extensionSettingsVisitWebStore'); | 173 'extensionSettingsVisitWebStore'); |
191 siteLink.hidden = false; | 174 siteLink.hidden = false; |
192 } | 175 } |
193 | 176 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 } | 314 } |
332 | 315 |
333 this.appendChild(node); | 316 this.appendChild(node); |
334 } | 317 } |
335 }; | 318 }; |
336 | 319 |
337 return { | 320 return { |
338 ExtensionsList: ExtensionsList | 321 ExtensionsList: ExtensionsList |
339 }; | 322 }; |
340 }); | 323 }); |
OLD | NEW |