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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/resources/ResourcesSection.js

Issue 2747123008: [DevTools] Separate old Application tab code (Closed)
Patch Set: Created 3 years, 9 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 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 Resources.ResourcesSection = class { 5 Resources.ResourcesSection = class {
6 /** 6 /**
7 * @param {!Resources.ResourcesPanel} storagePanel 7 * @param {!Resources.ApplicationPanelSidebar} storagePanel
8 * @param {!UI.TreeElement} treeElement 8 * @param {!UI.TreeElement} treeElement
9 */ 9 */
10 constructor(storagePanel, treeElement) { 10 constructor(storagePanel, treeElement) {
11 this._panel = storagePanel; 11 this._panel = storagePanel;
12 this._treeElement = treeElement; 12 this._treeElement = treeElement;
13 /** @type {!Map<string, !Resources.FrameTreeElement>} */ 13 /** @type {!Map<string, !Resources.FrameTreeElement>} */
14 this._treeElementForFrameId = new Map(); 14 this._treeElementForFrameId = new Map();
15 15
16 function addListener(eventType, handler, target) { 16 function addListener(eventType, handler, target) {
17 SDK.targetManager.addModelListener(SDK.ResourceTreeModel, eventType, event => handler.call(target, event.data)); 17 SDK.targetManager.addModelListener(SDK.ResourceTreeModel, eventType, event => handler.call(target, event.data));
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 this._frameAdded(frame); 113 this._frameAdded(frame);
114 for (var child of frame.childFrames) 114 for (var child of frame.childFrames)
115 this._populateFrame(child); 115 this._populateFrame(child);
116 for (var resource of frame.resources()) 116 for (var resource of frame.resources())
117 this._resourceAdded(resource); 117 this._resourceAdded(resource);
118 } 118 }
119 }; 119 };
120 120
121 Resources.FrameTreeElement = class extends Resources.BaseStorageTreeElement { 121 Resources.FrameTreeElement = class extends Resources.BaseStorageTreeElement {
122 /** 122 /**
123 * @param {!Resources.ResourcesPanel} storagePanel 123 * @param {!Resources.ApplicationPanelSidebar} storagePanel
124 * @param {!SDK.ResourceTreeFrame} frame 124 * @param {!SDK.ResourceTreeFrame} frame
125 */ 125 */
126 constructor(storagePanel, frame) { 126 constructor(storagePanel, frame) {
127 super(storagePanel, '', false); 127 super(storagePanel, '', false);
128 this._panel = storagePanel; 128 this._panel = storagePanel;
129 this._frame = frame; 129 this._frame = frame;
130 this._frameId = frame.id; 130 this._frameId = frame.id;
131 this._categoryElements = {}; 131 this._categoryElements = {};
132 this._treeElementForResource = {}; 132 this._treeElementForResource = {};
133 this.frameNavigated(frame); 133 this.frameNavigated(frame);
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 for (i = 0; i < childCount; ++i) { 237 for (i = 0; i < childCount; ++i) {
238 if (compare(childTreeElement, parentTreeElement.childAt(i)) < 0) 238 if (compare(childTreeElement, parentTreeElement.childAt(i)) < 0)
239 break; 239 break;
240 } 240 }
241 parentTreeElement.insertChild(childTreeElement, i); 241 parentTreeElement.insertChild(childTreeElement, i);
242 } 242 }
243 }; 243 };
244 244
245 Resources.FrameResourceTreeElement = class extends Resources.BaseStorageTreeElem ent { 245 Resources.FrameResourceTreeElement = class extends Resources.BaseStorageTreeElem ent {
246 /** 246 /**
247 * @param {!Resources.ResourcesPanel} storagePanel 247 * @param {!Resources.ApplicationPanelSidebar} storagePanel
248 * @param {!SDK.Resource} resource 248 * @param {!SDK.Resource} resource
249 */ 249 */
250 constructor(storagePanel, resource) { 250 constructor(storagePanel, resource) {
251 super(storagePanel, resource.displayName, false); 251 super(storagePanel, resource.displayName, false);
252 this._panel = storagePanel; 252 this._panel = storagePanel;
253 /** @type {!SDK.Resource} */ 253 /** @type {!SDK.Resource} */
254 this._resource = resource; 254 this._resource = resource;
255 /** @type {?SourceFrame.ResourceSourceFrame} */ 255 /** @type {?SourceFrame.ResourceSourceFrame} */
256 this._sourceFrame = null; 256 this._sourceFrame = null;
257 this.tooltip = resource.url; 257 this.tooltip = resource.url;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 _sourceView() { 347 _sourceView() {
348 if (!this._sourceFrame) { 348 if (!this._sourceFrame) {
349 this._sourceFrame = new SourceFrame.ResourceSourceFrame(this._resource); 349 this._sourceFrame = new SourceFrame.ResourceSourceFrame(this._resource);
350 this._sourceFrame.setHighlighterType(this._resource.canonicalMimeType()); 350 this._sourceFrame.setHighlighterType(this._resource.canonicalMimeType());
351 } 351 }
352 return this._sourceFrame; 352 return this._sourceFrame;
353 } 353 }
354 }; 354 };
355 355
356 Resources.FrameResourceTreeElement._symbol = Symbol('treeElement'); 356 Resources.FrameResourceTreeElement._symbol = Symbol('treeElement');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698