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

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

Issue 2366613003: [DevTools] Focus sidebar trees in certain panels by default. (Closed)
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/profiler/ProfilesPanel.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 20 matching lines...) Expand all
31 /** 31 /**
32 * @constructor 32 * @constructor
33 * @extends {WebInspector.PanelWithSidebar} 33 * @extends {WebInspector.PanelWithSidebar}
34 */ 34 */
35 WebInspector.AuditsPanel = function() 35 WebInspector.AuditsPanel = function()
36 { 36 {
37 WebInspector.PanelWithSidebar.call(this, "audits"); 37 WebInspector.PanelWithSidebar.call(this, "audits");
38 this.registerRequiredCSS("ui/panelEnablerView.css"); 38 this.registerRequiredCSS("ui/panelEnablerView.css");
39 this.registerRequiredCSS("audits/auditsPanel.css"); 39 this.registerRequiredCSS("audits/auditsPanel.css");
40 40
41 var sidebarTree = new TreeOutlineInShadow(); 41 this._sidebarTree = new TreeOutlineInShadow();
42 sidebarTree.registerRequiredCSS("audits/auditsSidebarTree.css"); 42 this._sidebarTree.registerRequiredCSS("audits/auditsSidebarTree.css");
43 this.panelSidebarElement().appendChild(sidebarTree.element); 43 this.panelSidebarElement().appendChild(this._sidebarTree.element);
44 this.setDefaultFocusedElement(sidebarTree.element);
45 44
46 this._auditsItemTreeElement = new WebInspector.AuditsSidebarTreeElement(this ); 45 this._auditsItemTreeElement = new WebInspector.AuditsSidebarTreeElement(this );
47 sidebarTree.appendChild(this._auditsItemTreeElement); 46 this._sidebarTree.appendChild(this._auditsItemTreeElement);
48 47
49 this._auditResultsTreeElement = new TreeElement(WebInspector.UIString("RESUL TS"), true); 48 this._auditResultsTreeElement = new TreeElement(WebInspector.UIString("RESUL TS"), true);
50 this._auditResultsTreeElement.selectable = false; 49 this._auditResultsTreeElement.selectable = false;
51 this._auditResultsTreeElement.listItemElement.classList.add("audits-sidebar- results"); 50 this._auditResultsTreeElement.listItemElement.classList.add("audits-sidebar- results");
52 this._auditResultsTreeElement.expand(); 51 this._auditResultsTreeElement.expand();
53 sidebarTree.appendChild(this._auditResultsTreeElement); 52 this._sidebarTree.appendChild(this._auditResultsTreeElement);
54 53
55 this._constructCategories(); 54 this._constructCategories();
56 55
57 this._auditController = new WebInspector.AuditController(this); 56 this._auditController = new WebInspector.AuditController(this);
58 this._launcherView = new WebInspector.AuditLauncherView(this._auditControlle r); 57 this._launcherView = new WebInspector.AuditLauncherView(this._auditControlle r);
59 for (var id in this.categoriesById) 58 for (var id in this.categoriesById)
60 this._launcherView.addCategory(this.categoriesById[id]); 59 this._launcherView.addCategory(this.categoriesById[id]);
61 60
62 var extensionCategories = WebInspector.extensionServer.auditCategories(); 61 var extensionCategories = WebInspector.extensionServer.auditCategories();
63 for (var i = 0; i < extensionCategories.length; ++i) { 62 for (var i = 0; i < extensionCategories.length; ++i) {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 this.splitWidget().setMainWidget(x); 160 this.splitWidget().setMainWidget(x);
162 }, 161 },
163 162
164 wasShown: function() 163 wasShown: function()
165 { 164 {
166 WebInspector.Panel.prototype.wasShown.call(this); 165 WebInspector.Panel.prototype.wasShown.call(this);
167 if (!this._visibleView) 166 if (!this._visibleView)
168 this._auditsItemTreeElement.select(); 167 this._auditsItemTreeElement.select();
169 }, 168 },
170 169
170 /**
171 * @override
172 */
173 focus: function()
174 {
175 this._sidebarTree.focus();
einbinder 2016/09/22 22:48:24 Why not this.setDefaultFocusedChild(this.splitWidg
dgozman 2016/09/23 00:43:09 I see two problems in that: - we call setDefaultFo
176 },
177
171 clearResults: function() 178 clearResults: function()
172 { 179 {
173 this._auditsItemTreeElement.revealAndSelect(); 180 this._auditsItemTreeElement.revealAndSelect();
174 this._auditResultsTreeElement.removeChildren(); 181 this._auditResultsTreeElement.removeChildren();
175 }, 182 },
176 183
177 /** 184 /**
178 * @param {!WebInspector.Event} event 185 * @param {!WebInspector.Event} event
179 */ 186 */
180 _extensionAuditCategoryAdded: function(event) 187 _extensionAuditCategoryAdded: function(event)
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 } 544 }
538 545
539 // Contributed audit rules should go into this namespace. 546 // Contributed audit rules should go into this namespace.
540 WebInspector.AuditRules = {}; 547 WebInspector.AuditRules = {};
541 548
542 /** 549 /**
543 * Contributed audit categories should go into this namespace. 550 * Contributed audit categories should go into this namespace.
544 * @type {!Object.<string, function(new:WebInspector.AuditCategory)>} 551 * @type {!Object.<string, function(new:WebInspector.AuditCategory)>}
545 */ 552 */
546 WebInspector.AuditCategories = {}; 553 WebInspector.AuditCategories = {};
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/profiler/ProfilesPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698