OLD | NEW |
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 20 matching lines...) Expand all Loading... |
31 * @implements {SDK.TargetManager.Observer} | 31 * @implements {SDK.TargetManager.Observer} |
32 * @unrestricted | 32 * @unrestricted |
33 */ | 33 */ |
34 Resources.ResourcesPanel = class extends UI.PanelWithSidebar { | 34 Resources.ResourcesPanel = class extends UI.PanelWithSidebar { |
35 constructor() { | 35 constructor() { |
36 super('resources'); | 36 super('resources'); |
37 this.registerRequiredCSS('resources/resourcesPanel.css'); | 37 this.registerRequiredCSS('resources/resourcesPanel.css'); |
38 | 38 |
39 this._resourcesLastSelectedItemSetting = Common.settings.createSetting('reso
urcesLastSelectedItem', {}); | 39 this._resourcesLastSelectedItemSetting = Common.settings.createSetting('reso
urcesLastSelectedItem', {}); |
40 | 40 |
41 this._sidebarTree = new TreeOutlineInShadow(); | 41 this._sidebarTree = new UI.TreeOutlineInShadow(); |
42 this._sidebarTree.element.classList.add('resources-sidebar'); | 42 this._sidebarTree.element.classList.add('resources-sidebar'); |
43 this._sidebarTree.registerRequiredCSS('resources/resourcesSidebar.css'); | 43 this._sidebarTree.registerRequiredCSS('resources/resourcesSidebar.css'); |
44 this._sidebarTree.element.classList.add('filter-all'); | 44 this._sidebarTree.element.classList.add('filter-all'); |
45 this.panelSidebarElement().appendChild(this._sidebarTree.element); | 45 this.panelSidebarElement().appendChild(this._sidebarTree.element); |
46 | 46 |
47 this._applicationTreeElement = this._addSidebarSection(Common.UIString('Appl
ication')); | 47 this._applicationTreeElement = this._addSidebarSection(Common.UIString('Appl
ication')); |
48 this._manifestTreeElement = new Resources.AppManifestTreeElement(this); | 48 this._manifestTreeElement = new Resources.AppManifestTreeElement(this); |
49 this._applicationTreeElement.appendChild(this._manifestTreeElement); | 49 this._applicationTreeElement.appendChild(this._manifestTreeElement); |
50 this.serviceWorkersTreeElement = new Resources.ServiceWorkersTreeElement(thi
s); | 50 this.serviceWorkersTreeElement = new Resources.ServiceWorkersTreeElement(thi
s); |
51 this._applicationTreeElement.appendChild(this.serviceWorkersTreeElement); | 51 this._applicationTreeElement.appendChild(this.serviceWorkersTreeElement); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 /** | 107 /** |
108 * @return {!Resources.ResourcesPanel} | 108 * @return {!Resources.ResourcesPanel} |
109 */ | 109 */ |
110 static _instance() { | 110 static _instance() { |
111 return /** @type {!Resources.ResourcesPanel} */ (self.runtime.sharedInstance
(Resources.ResourcesPanel)); | 111 return /** @type {!Resources.ResourcesPanel} */ (self.runtime.sharedInstance
(Resources.ResourcesPanel)); |
112 } | 112 } |
113 | 113 |
114 /** | 114 /** |
115 * @param {string} title | 115 * @param {string} title |
116 * @return {!TreeElement} | 116 * @return {!UI.TreeElement} |
117 */ | 117 */ |
118 _addSidebarSection(title) { | 118 _addSidebarSection(title) { |
119 var treeElement = new TreeElement(title, true); | 119 var treeElement = new UI.TreeElement(title, true); |
120 treeElement.listItemElement.classList.add('storage-group-list-item'); | 120 treeElement.listItemElement.classList.add('storage-group-list-item'); |
121 treeElement.setCollapsible(false); | 121 treeElement.setCollapsible(false); |
122 treeElement.selectable = false; | 122 treeElement.selectable = false; |
123 this._sidebarTree.appendChild(treeElement); | 123 this._sidebarTree.appendChild(treeElement); |
124 return treeElement; | 124 return treeElement; |
125 } | 125 } |
126 | 126 |
127 /** | 127 /** |
128 * @override | 128 * @override |
129 * @param {!SDK.Target} target | 129 * @param {!SDK.Target} target |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 if (!(resource instanceof SDK.Resource)) | 821 if (!(resource instanceof SDK.Resource)) |
822 return Promise.reject(new Error('Internal error: not a resource')); | 822 return Promise.reject(new Error('Internal error: not a resource')); |
823 var panel = Resources.ResourcesPanel._instance(); | 823 var panel = Resources.ResourcesPanel._instance(); |
824 return UI.viewManager.showView('resources').then(panel.showResource.bind(pan
el, resource)); | 824 return UI.viewManager.showView('resources').then(panel.showResource.bind(pan
el, resource)); |
825 } | 825 } |
826 }; | 826 }; |
827 | 827 |
828 /** | 828 /** |
829 * @unrestricted | 829 * @unrestricted |
830 */ | 830 */ |
831 Resources.BaseStorageTreeElement = class extends TreeElement { | 831 Resources.BaseStorageTreeElement = class extends UI.TreeElement { |
832 /** | 832 /** |
833 * @param {!Resources.ResourcesPanel} storagePanel | 833 * @param {!Resources.ResourcesPanel} storagePanel |
834 * @param {string} title | 834 * @param {string} title |
835 * @param {?Array.<string>=} iconClasses | 835 * @param {?Array.<string>=} iconClasses |
836 * @param {boolean=} expandable | 836 * @param {boolean=} expandable |
837 * @param {boolean=} noIcon | 837 * @param {boolean=} noIcon |
838 */ | 838 */ |
839 constructor(storagePanel, title, iconClasses, expandable, noIcon) { | 839 constructor(storagePanel, title, iconClasses, expandable, noIcon) { |
840 super(title, expandable); | 840 super(title, expandable); |
841 this._storagePanel = storagePanel; | 841 this._storagePanel = storagePanel; |
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2042 | 2042 |
2043 this.element.classList.add('storage-view'); | 2043 this.element.classList.add('storage-view'); |
2044 this._emptyWidget = new UI.EmptyWidget(''); | 2044 this._emptyWidget = new UI.EmptyWidget(''); |
2045 this._emptyWidget.show(this.element); | 2045 this._emptyWidget.show(this.element); |
2046 } | 2046 } |
2047 | 2047 |
2048 setText(text) { | 2048 setText(text) { |
2049 this._emptyWidget.text = text; | 2049 this._emptyWidget.text = text; |
2050 } | 2050 } |
2051 }; | 2051 }; |
OLD | NEW |