| OLD | NEW |
| 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.ResourcesPanel = class extends UI.PanelWithSidebar { | 5 Resources.ResourcesPanel = class extends UI.PanelWithSidebar { |
| 6 constructor() { | 6 constructor() { |
| 7 super('resources'); | 7 super('resources'); |
| 8 this.registerRequiredCSS('resources/resourcesPanel.css'); | 8 this.registerRequiredCSS('resources/resourcesPanel.css'); |
| 9 | 9 |
| 10 this._resourcesLastSelectedItemSetting = Common.settings.createSetting('reso
urcesLastSelectedItem', ''); | 10 this._resourcesLastSelectedItemSetting = Common.settings.createSetting('reso
urcesLastSelectedElementPath', []); |
| 11 | 11 |
| 12 /** @type {?UI.Widget} */ | 12 /** @type {?UI.Widget} */ |
| 13 this.visibleView = null; | 13 this.visibleView = null; |
| 14 | 14 |
| 15 /** @type {?Resources.StorageCategoryView} */ | 15 /** @type {?Resources.StorageCategoryView} */ |
| 16 this._categoryView = null; | 16 this._categoryView = null; |
| 17 | 17 |
| 18 var mainContainer = new UI.VBox(); | 18 var mainContainer = new UI.VBox(); |
| 19 this.storageViews = mainContainer.element.createChild('div', 'vbox flex-auto
'); | 19 this.storageViews = mainContainer.element.createChild('div', 'vbox flex-auto
'); |
| 20 this._storageViewToolbar = new UI.Toolbar('resources-toolbar', mainContainer
.element); | 20 this._storageViewToolbar = new UI.Toolbar('resources-toolbar', mainContainer
.element); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 } | 53 } |
| 54 | 54 |
| 55 /** | 55 /** |
| 56 * @override | 56 * @override |
| 57 */ | 57 */ |
| 58 focus() { | 58 focus() { |
| 59 this._sidebar.focus(); | 59 this._sidebar.focus(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 /** | 62 /** |
| 63 * @return {string} | 63 * @return {!Array<string>} |
| 64 */ | 64 */ |
| 65 lastSelectedItemURL() { | 65 lastSelectedItemPath() { |
| 66 return this._resourcesLastSelectedItemSetting.get(); | 66 return this._resourcesLastSelectedItemSetting.get(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 setLastSelectedItemURL(url) { | 69 /** |
| 70 this._resourcesLastSelectedItemSetting.set(url); | 70 * @param {!Array<string>} path |
| 71 */ |
| 72 setLastSelectedItemPath(path) { |
| 73 this._resourcesLastSelectedItemSetting.set(path); |
| 71 } | 74 } |
| 72 | 75 |
| 73 resetView() { | 76 resetView() { |
| 74 if (this.visibleView && Resources.ResourcesPanel._shouldCloseOnReset(this.vi
sibleView)) | 77 if (this.visibleView && Resources.ResourcesPanel._shouldCloseOnReset(this.vi
sibleView)) |
| 75 this.showView(null); | 78 this.showView(null); |
| 76 } | 79 } |
| 77 | 80 |
| 78 /** | 81 /** |
| 79 * @param {?UI.Widget} view | 82 * @param {?UI.Widget} view |
| 80 */ | 83 */ |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 * @param {!Object} resource | 173 * @param {!Object} resource |
| 171 * @return {!Promise} | 174 * @return {!Promise} |
| 172 */ | 175 */ |
| 173 reveal(resource) { | 176 reveal(resource) { |
| 174 if (!(resource instanceof SDK.Resource)) | 177 if (!(resource instanceof SDK.Resource)) |
| 175 return Promise.reject(new Error('Internal error: not a resource')); | 178 return Promise.reject(new Error('Internal error: not a resource')); |
| 176 var panel = Resources.ResourcesPanel._instance()._sidebar; | 179 var panel = Resources.ResourcesPanel._instance()._sidebar; |
| 177 return UI.viewManager.showView('resources').then(panel.showResource.bind(pan
el, resource)); | 180 return UI.viewManager.showView('resources').then(panel.showResource.bind(pan
el, resource)); |
| 178 } | 181 } |
| 179 }; | 182 }; |
| OLD | NEW |