Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3960)

Unified Diff: chrome/browser/resources/extensions/extension_list.js

Issue 11434024: Support extension highlighting on the extensions page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/extensions/extensions.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 '';
}
};
« no previous file with comments | « no previous file | chrome/browser/resources/extensions/extensions.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698