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

Unified Diff: Source/devtools/front_end/audits/AuditsPanel.js

Issue 667623002: DevTools: make extension server a part of core, panels' code should depend on it. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: for review Created 6 years, 2 months 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
Index: Source/devtools/front_end/audits/AuditsPanel.js
diff --git a/Source/devtools/front_end/audits/AuditsPanel.js b/Source/devtools/front_end/audits/AuditsPanel.js
index f6b32a8a9195f4179b849075dc7ba9e293e5534f..c952a15f43a8ebed441de48690e26904b879ece7 100644
--- a/Source/devtools/front_end/audits/AuditsPanel.js
+++ b/Source/devtools/front_end/audits/AuditsPanel.js
@@ -55,6 +55,13 @@ WebInspector.AuditsPanel = function()
this._launcherView = new WebInspector.AuditLauncherView(this._auditController);
for (var id in this.categoriesById)
this._launcherView.addCategory(this.categoriesById[id]);
+
+ var extensionCategories = WebInspector.extensionServer.auditCategories();
+ for (var i = 0; i < extensionCategories.length; ++i) {
+ var category = extensionCategories[i];
+ this.addCategory(new WebInspector.AuditExtensionCategory(category.extensionOrigin, category.id, category.displayName, category.ruleCount));
+ }
+ WebInspector.extensionServer.addEventListener(WebInspector.ExtensionServer.Events.AuditCategoryAdded, this._extensionAuditCategoryAdded, this);
}
WebInspector.AuditsPanel.prototype = {
@@ -168,6 +175,15 @@ WebInspector.AuditsPanel.prototype = {
this.auditResultsTreeElement.removeChildren();
},
+ /**
+ * @param {!WebInspector.Event} event
+ */
+ _extensionAuditCategoryAdded: function(event)
+ {
+ var category = /** @type {!WebInspector.ExtensionAuditCategory} */ (event.data);
+ this.addCategory(new WebInspector.AuditExtensionCategory(category.extensionOrigin, category.id, category.displayName, category.ruleCount));
+ },
+
__proto__: WebInspector.PanelWithSidebarTree.prototype
}

Powered by Google App Engine
This is Rietveld 408576698