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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/audits/AuditsPanel.js

Issue 2174863003: DevTools: traverse widget hierarchy to reveal views. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lcean Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 var resultTreeElement = new WebInspector.AuditResultSidebarTreeElement(t his, results, mainResourceURL, ordinal); 122 var resultTreeElement = new WebInspector.AuditResultSidebarTreeElement(t his, results, mainResourceURL, ordinal);
123 this.auditResultsTreeElement.appendChild(resultTreeElement); 123 this.auditResultsTreeElement.appendChild(resultTreeElement);
124 resultTreeElement.revealAndSelect(); 124 resultTreeElement.revealAndSelect();
125 }, 125 },
126 126
127 /** 127 /**
128 * @param {!Array.<!WebInspector.AuditCategoryResult>} categoryResults 128 * @param {!Array.<!WebInspector.AuditCategoryResult>} categoryResults
129 */ 129 */
130 showResults: function(categoryResults) 130 showResults: function(categoryResults)
131 { 131 {
132 if (!categoryResults._resultView) 132 if (!categoryResults._resultView) {
133 categoryResults._resultView = new WebInspector.AuditResultView(categ oryResults); 133 categoryResults.sort((a, b) => (a.title || "").localeCompare(b.title || ""));
134 134 var resultView = new WebInspector.View.ExpandableStackContainer();
135 for (var i = 0; i < categoryResults.length; ++i)
136 resultView.appendView(new WebInspector.AuditCategoryResultPane(c ategoryResults[i]), true);
137 categoryResults._resultView = resultView;
138 }
135 this.visibleView = categoryResults._resultView; 139 this.visibleView = categoryResults._resultView;
136 }, 140 },
137 141
138 showLauncherView: function() 142 showLauncherView: function()
139 { 143 {
140 this.visibleView = this._launcherView; 144 this.visibleView = this._launcherView;
141 }, 145 },
142 146
143 get visibleView() 147 get visibleView()
144 { 148 {
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 } 575 }
572 576
573 // Contributed audit rules should go into this namespace. 577 // Contributed audit rules should go into this namespace.
574 WebInspector.AuditRules = {}; 578 WebInspector.AuditRules = {};
575 579
576 /** 580 /**
577 * Contributed audit categories should go into this namespace. 581 * Contributed audit categories should go into this namespace.
578 * @type {!Object.<string, function(new:WebInspector.AuditCategory)>} 582 * @type {!Object.<string, function(new:WebInspector.AuditCategory)>}
579 */ 583 */
580 WebInspector.AuditCategories = {}; 584 WebInspector.AuditCategories = {};
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698