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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/resources/ResourcesPanel.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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
4 * Copyright (C) 2013 Samsung Electronics. All rights reserved. 4 * Copyright (C) 2013 Samsung Electronics. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 27 matching lines...) Expand all
38 WebInspector.PanelWithSidebar.call(this, "resources"); 38 WebInspector.PanelWithSidebar.call(this, "resources");
39 this.registerRequiredCSS("resources/resourcesPanel.css"); 39 this.registerRequiredCSS("resources/resourcesPanel.css");
40 40
41 this._resourcesLastSelectedItemSetting = WebInspector.settings.createSetting ("resourcesLastSelectedItem", {}); 41 this._resourcesLastSelectedItemSetting = WebInspector.settings.createSetting ("resourcesLastSelectedItem", {});
42 42
43 this._sidebarTree = new TreeOutlineInShadow(); 43 this._sidebarTree = new TreeOutlineInShadow();
44 this._sidebarTree.element.classList.add("resources-sidebar"); 44 this._sidebarTree.element.classList.add("resources-sidebar");
45 this._sidebarTree.registerRequiredCSS("resources/resourcesSidebar.css"); 45 this._sidebarTree.registerRequiredCSS("resources/resourcesSidebar.css");
46 this._sidebarTree.element.classList.add("filter-all"); 46 this._sidebarTree.element.classList.add("filter-all");
47 this.panelSidebarElement().appendChild(this._sidebarTree.element); 47 this.panelSidebarElement().appendChild(this._sidebarTree.element);
48 this.setDefaultFocusedElement(this._sidebarTree.element);
49 48
50 this._applicationTreeElement = this._addSidebarSection(WebInspector.UIString ("Application")); 49 this._applicationTreeElement = this._addSidebarSection(WebInspector.UIString ("Application"));
51 this._manifestTreeElement = new WebInspector.AppManifestTreeElement(this); 50 this._manifestTreeElement = new WebInspector.AppManifestTreeElement(this);
52 this._applicationTreeElement.appendChild(this._manifestTreeElement); 51 this._applicationTreeElement.appendChild(this._manifestTreeElement);
53 this.serviceWorkersTreeElement = new WebInspector.ServiceWorkersTreeElement( this); 52 this.serviceWorkersTreeElement = new WebInspector.ServiceWorkersTreeElement( this);
54 this._applicationTreeElement.appendChild(this.serviceWorkersTreeElement); 53 this._applicationTreeElement.appendChild(this.serviceWorkersTreeElement);
55 var clearStorageTreeElement = new WebInspector.ClearStorageTreeElement(this) ; 54 var clearStorageTreeElement = new WebInspector.ClearStorageTreeElement(this) ;
56 this._applicationTreeElement.appendChild(clearStorageTreeElement); 55 this._applicationTreeElement.appendChild(clearStorageTreeElement);
57 56
58 var storageTreeElement = this._addSidebarSection(WebInspector.UIString("Stor age")); 57 var storageTreeElement = this._addSidebarSection(WebInspector.UIString("Stor age"));
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 if (resourceTreeModel) { 154 if (resourceTreeModel) {
156 resourceTreeModel.removeEventListener(WebInspector.ResourceTreeModel .Events.CachedResourcesLoaded, this._initialize, this); 155 resourceTreeModel.removeEventListener(WebInspector.ResourceTreeModel .Events.CachedResourcesLoaded, this._initialize, this);
157 resourceTreeModel.removeEventListener(WebInspector.ResourceTreeModel .Events.WillLoadCachedResources, this._resetWithFrames, this); 156 resourceTreeModel.removeEventListener(WebInspector.ResourceTreeModel .Events.WillLoadCachedResources, this._resetWithFrames, this);
158 } 157 }
159 this._databaseModel.removeEventListener(WebInspector.DatabaseModel.Event s.DatabaseAdded, this._databaseAdded, this); 158 this._databaseModel.removeEventListener(WebInspector.DatabaseModel.Event s.DatabaseAdded, this._databaseAdded, this);
160 this._databaseModel.removeEventListener(WebInspector.DatabaseModel.Event s.DatabasesRemoved, this._resetWebSQL, this); 159 this._databaseModel.removeEventListener(WebInspector.DatabaseModel.Event s.DatabasesRemoved, this._resetWebSQL, this);
161 160
162 this._resetWithFrames(); 161 this._resetWithFrames();
163 }, 162 },
164 163
164 /**
165 * @override
166 */
167 focus: function()
168 {
169 this._sidebarTree.focus();
170 },
171
165 _initialize: function() 172 _initialize: function()
166 { 173 {
167 this._databaseModel.enable(); 174 this._databaseModel.enable();
168 175
169 var indexedDBModel = WebInspector.IndexedDBModel.fromTarget(this._target ); 176 var indexedDBModel = WebInspector.IndexedDBModel.fromTarget(this._target );
170 if (indexedDBModel) 177 if (indexedDBModel)
171 indexedDBModel.enable(); 178 indexedDBModel.enable();
172 179
173 var cacheStorageModel = WebInspector.ServiceWorkerCacheModel.fromTarget( this._target); 180 var cacheStorageModel = WebInspector.ServiceWorkerCacheModel.fromTarget( this._target);
174 if (cacheStorageModel) 181 if (cacheStorageModel)
(...skipping 2032 matching lines...) Expand 10 before | Expand all | Expand 10 after
2207 WebInspector.inspectorView.setCurrentPanel(WebInspector.ResourcesPanel._inst ance()); 2214 WebInspector.inspectorView.setCurrentPanel(WebInspector.ResourcesPanel._inst ance());
2208 } 2215 }
2209 2216
2210 /** 2217 /**
2211 * @return {!WebInspector.ResourcesPanel} 2218 * @return {!WebInspector.ResourcesPanel}
2212 */ 2219 */
2213 WebInspector.ResourcesPanel._instance = function() 2220 WebInspector.ResourcesPanel._instance = function()
2214 { 2221 {
2215 return /** @type {!WebInspector.ResourcesPanel} */ (self.runtime.sharedInsta nce(WebInspector.ResourcesPanel)); 2222 return /** @type {!WebInspector.ResourcesPanel} */ (self.runtime.sharedInsta nce(WebInspector.ResourcesPanel));
2216 } 2223 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698