Chromium Code Reviews| Index: chrome/browser/resources/extensions/extension_list.js |
| =================================================================== |
| --- chrome/browser/resources/extensions/extension_list.js (revision 169729) |
| +++ chrome/browser/resources/extensions/extension_list.js (working copy) |
| @@ -50,6 +50,10 @@ |
| // Iterate over the extension data and add each item to the list. |
| this.data_.extensions.forEach(this.createNode_, this); |
| + var id_to_highlight = this.extensionIdToHighlight(); |
| + if (id_to_highlight) |
| + $(id_to_highlight).scrollIntoView(); |
|
Finnur
2012/11/29 04:07:34
After fighting with this for a while I'm ready to
Aaron Boodman
2012/11/29 21:39:40
Is it because of the heading layer? You can get th
|
| + |
| if (this.data_.extensions.length == 0) |
| this.classList.add('empty-extension-list'); |
| else |
| @@ -74,6 +78,9 @@ |
| if (!extension.userModifiable) |
| node.classList.add('may-not-disable'); |
| + if (node.id == this.extensionIdToHighlight()) |
| + node.classList.add('extension-highlight'); |
| + |
| var item = node.querySelector('.extension-list-item'); |
| item.style.backgroundImage = 'url(' + extension.icon + ')'; |
| @@ -280,6 +287,20 @@ |
| } |
| this.appendChild(node); |
| + }, |
| + |
| + /** |
| + * Returns the extension id of the extension to highlight, if any. |
| + * @private |
| + */ |
| + extensionIdToHighlight: function() { |
|
Aaron Boodman
2012/11/29 21:39:40
See parseQueryParams() in browser/resources/shared
|
| + var queryString = location.search.substring(1).split('&'); |
| + for (var i = 0; i < queryString.length; ++i) { |
| + var param = queryString[i].split('='); |
| + if (param[0] == 'id' && param.length > 1) |
| + return param[1]; |
| + } |
| + return ''; |
| } |
| }; |