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

Unified Diff: third_party/WebKit/Source/devtools/front_end/resources/ApplicationPanelSidebar.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/resources/ApplicationPanelSidebar.js
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/ResourcesPanel.js b/third_party/WebKit/Source/devtools/front_end/resources/ApplicationPanelSidebar.js
similarity index 96%
copy from third_party/WebKit/Source/devtools/front_end/resources/ResourcesPanel.js
copy to third_party/WebKit/Source/devtools/front_end/resources/ApplicationPanelSidebar.js
index 2229844043a037c2238ccf6864a77ac10a27a075..7a869d2793ce3f8f5126f926d5e36d58295e3eff 100644
--- a/third_party/WebKit/Source/devtools/front_end/resources/ResourcesPanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/resources/ApplicationPanelSidebar.js
@@ -31,18 +31,20 @@
* @implements {SDK.TargetManager.Observer}
* @unrestricted
*/
-Resources.ResourcesPanel = class extends UI.PanelWithSidebar {
- constructor() {
- super('resources');
- this.registerRequiredCSS('resources/resourcesPanel.css');
-
+Resources.ApplicationPanelSidebar = class extends Common.Object {
+ /**
+ * @param {!Element} sidebarElement
+ * @param {!UI.SplitWidget} splitWidget
+ */
+ constructor(sidebarElement, splitWidget) {
+ super();
this._resourcesLastSelectedItemSetting = Common.settings.createSetting('resourcesLastSelectedItem', {});
this._sidebarTree = new UI.TreeOutlineInShadow();
this._sidebarTree.element.classList.add('resources-sidebar');
this._sidebarTree.registerRequiredCSS('resources/resourcesSidebar.css');
this._sidebarTree.element.classList.add('filter-all');
- this.panelSidebarElement().appendChild(this._sidebarTree.element);
+ sidebarElement.appendChild(this._sidebarTree.element);
dgozman 2017/03/17 17:50:11 Instead of passing sidebarElement, let's have this
eostroukhov 2017/03/17 19:01:12 Done.
this._applicationTreeElement = this._addSidebarSection(Common.UIString('Application'));
this._manifestTreeElement = new Resources.AppManifestTreeElement(this);
@@ -93,7 +95,7 @@ Resources.ResourcesPanel = class extends UI.PanelWithSidebar {
var mainContainer = new UI.VBox();
this.storageViews = mainContainer.element.createChild('div', 'vbox flex-auto');
this._storageViewToolbar = new UI.Toolbar('resources-toolbar', mainContainer.element);
- this.splitWidget().setMainWidget(mainContainer);
+ splitWidget.setMainWidget(mainContainer);
dgozman 2017/03/17 17:50:11 Same for splitWidget.
eostroukhov 2017/03/17 19:01:12 Done.
/** @type {!Map.<!Resources.Database, !Object.<string, !Resources.DatabaseTableView>>} */
this._databaseTableViews = new Map();
@@ -111,8 +113,8 @@ Resources.ResourcesPanel = class extends UI.PanelWithSidebar {
/** @type {?Resources.CookieItemsView} */
this._cookieView = null;
- this.panelSidebarElement().addEventListener('mousemove', this._onmousemove.bind(this), false);
- this.panelSidebarElement().addEventListener('mouseleave', this._onmouseleave.bind(this), false);
+ sidebarElement.addEventListener('mousemove', this._onmousemove.bind(this), false);
+ sidebarElement.addEventListener('mouseleave', this._onmouseleave.bind(this), false);
SDK.targetManager.observeTargets(this);
SDK.targetManager.addModelListener(
@@ -120,10 +122,11 @@ Resources.ResourcesPanel = class extends UI.PanelWithSidebar {
}
/**
- * @return {!Resources.ResourcesPanel}
+ * @return {!Resources.ApplicationPanelSidebar}
*/
static _instance() {
dgozman 2017/03/17 17:50:11 Who needs this?
eostroukhov 2017/03/17 19:01:12 Done.
- return /** @type {!Resources.ResourcesPanel} */ (self.runtime.sharedInstance(Resources.ResourcesPanel));
+ return /** @type {!Resources.ApplicationPanelSidebar} */ (
+ self.runtime.sharedInstance(Resources.ApplicationPanelSidebar));
dgozman 2017/03/17 17:50:11 Note this requires a declaration in module.json.
eostroukhov 2017/03/17 19:01:12 Code was removed
}
/**
@@ -185,9 +188,6 @@ Resources.ResourcesPanel = class extends UI.PanelWithSidebar {
this._resetWithFrames();
}
- /**
- * @override
- */
focus() {
dgozman 2017/03/17 17:50:11 Who is calling this method now? Should we make thi
eostroukhov 2017/03/17 19:01:12 Panel will now directly set focus on a sidebar tre
this._sidebarTree.focus();
}
@@ -405,7 +405,7 @@ Resources.ResourcesPanel = class extends UI.PanelWithSidebar {
*/
selectDOMStorage(domStorage) {
if (domStorage) {
- this._showDOMStorage(domStorage);
+ this.showDOMStorage(domStorage);
this._domStorageTreeElements.get(domStorage).select();
}
}
@@ -475,7 +475,7 @@ Resources.ResourcesPanel = class extends UI.PanelWithSidebar {
/**
* @param {!Resources.DOMStorage} domStorage
*/
- _showDOMStorage(domStorage) {
+ showDOMStorage(domStorage) {
if (!domStorage)
return;
@@ -715,29 +715,11 @@ Resources.ResourcesPanel = class extends UI.PanelWithSidebar {
};
/**
- * @implements {Common.Revealer}
- * @unrestricted
- */
-Resources.ResourcesPanel.ResourceRevealer = class {
- /**
- * @override
- * @param {!Object} resource
- * @return {!Promise}
- */
- reveal(resource) {
- if (!(resource instanceof SDK.Resource))
- return Promise.reject(new Error('Internal error: not a resource'));
- var panel = Resources.ResourcesPanel._instance();
- return UI.viewManager.showView('resources').then(panel.showResource.bind(panel, resource));
- }
-};
-
-/**
* @unrestricted
*/
Resources.BaseStorageTreeElement = class extends UI.TreeElement {
/**
- * @param {!Resources.ResourcesPanel} storagePanel
+ * @param {!Resources.ApplicationPanelSidebar} storagePanel
* @param {string} title
* @param {boolean} expandable
*/
@@ -777,7 +759,7 @@ Resources.BaseStorageTreeElement = class extends UI.TreeElement {
*/
Resources.StorageCategoryTreeElement = class extends Resources.BaseStorageTreeElement {
/**
- * @param {!Resources.ResourcesPanel} storagePanel
+ * @param {!Resources.ApplicationPanelSidebar} storagePanel
* @param {string} categoryName
* @param {string} settingsKey
*/
@@ -838,7 +820,7 @@ Resources.StorageCategoryTreeElement = class extends Resources.BaseStorageTreeEl
*/
Resources.DatabaseTreeElement = class extends Resources.BaseStorageTreeElement {
/**
- * @param {!Resources.ResourcesPanel} storagePanel
+ * @param {!Resources.ApplicationPanelSidebar} storagePanel
* @param {!Resources.Database} database
*/
constructor(storagePanel, database) {
@@ -918,7 +900,7 @@ Resources.DatabaseTableTreeElement = class extends Resources.BaseStorageTreeElem
*/
Resources.ServiceWorkerCacheTreeElement = class extends Resources.StorageCategoryTreeElement {
/**
- * @param {!Resources.ResourcesPanel} storagePanel
+ * @param {!Resources.ApplicationPanelSidebar} storagePanel
*/
constructor(storagePanel) {
super(storagePanel, Common.UIString('Cache Storage'), 'CacheStorage');
@@ -1024,7 +1006,7 @@ Resources.ServiceWorkerCacheTreeElement = class extends Resources.StorageCategor
*/
Resources.SWCacheTreeElement = class extends Resources.BaseStorageTreeElement {
/**
- * @param {!Resources.ResourcesPanel} storagePanel
+ * @param {!Resources.ApplicationPanelSidebar} storagePanel
* @param {!SDK.ServiceWorkerCacheModel} model
* @param {!SDK.ServiceWorkerCacheModel.Cache} cache
*/
@@ -1092,7 +1074,7 @@ Resources.SWCacheTreeElement = class extends Resources.BaseStorageTreeElement {
*/
Resources.ServiceWorkersTreeElement = class extends Resources.BaseStorageTreeElement {
/**
- * @param {!Resources.ResourcesPanel} storagePanel
+ * @param {!Resources.ApplicationPanelSidebar} storagePanel
*/
constructor(storagePanel) {
super(storagePanel, Common.UIString('Service Workers'), false);
@@ -1125,7 +1107,7 @@ Resources.ServiceWorkersTreeElement = class extends Resources.BaseStorageTreeEle
*/
Resources.AppManifestTreeElement = class extends Resources.BaseStorageTreeElement {
/**
- * @param {!Resources.ResourcesPanel} storagePanel
+ * @param {!Resources.ApplicationPanelSidebar} storagePanel
*/
constructor(storagePanel) {
super(storagePanel, Common.UIString('Manifest'), false);
@@ -1158,7 +1140,7 @@ Resources.AppManifestTreeElement = class extends Resources.BaseStorageTreeElemen
*/
Resources.ClearStorageTreeElement = class extends Resources.BaseStorageTreeElement {
/**
- * @param {!Resources.ResourcesPanel} storagePanel
+ * @param {!Resources.ApplicationPanelSidebar} storagePanel
*/
constructor(storagePanel) {
super(storagePanel, Common.UIString('Clear storage'), false);
@@ -1180,7 +1162,7 @@ Resources.ClearStorageTreeElement = class extends Resources.BaseStorageTreeEleme
onselect(selectedByUser) {
super.onselect(selectedByUser);
if (!this._view)
- this._view = new Resources.ClearStorageView(this._storagePanel);
+ this._view = new Resources.ClearStorageView();
this.showView(this._view);
return false;
}
@@ -1191,7 +1173,7 @@ Resources.ClearStorageTreeElement = class extends Resources.BaseStorageTreeEleme
*/
Resources.IndexedDBTreeElement = class extends Resources.StorageCategoryTreeElement {
/**
- * @param {!Resources.ResourcesPanel} storagePanel
+ * @param {!Resources.ApplicationPanelSidebar} storagePanel
*/
constructor(storagePanel) {
super(storagePanel, Common.UIString('IndexedDB'), 'IndexedDB');
@@ -1313,7 +1295,7 @@ Resources.IndexedDBTreeElement = class extends Resources.StorageCategoryTreeElem
*/
Resources.IDBDatabaseTreeElement = class extends Resources.BaseStorageTreeElement {
/**
- * @param {!Resources.ResourcesPanel} storagePanel
+ * @param {!Resources.ApplicationPanelSidebar} storagePanel
* @param {!Resources.IndexedDBModel} model
* @param {!Resources.IndexedDBModel.DatabaseId} databaseId
*/
@@ -1414,7 +1396,7 @@ Resources.IDBDatabaseTreeElement = class extends Resources.BaseStorageTreeElemen
*/
Resources.IDBObjectStoreTreeElement = class extends Resources.BaseStorageTreeElement {
/**
- * @param {!Resources.ResourcesPanel} storagePanel
+ * @param {!Resources.ApplicationPanelSidebar} storagePanel
* @param {!Resources.IndexedDBModel} model
* @param {!Resources.IndexedDBModel.DatabaseId} databaseId
* @param {!Resources.IndexedDBModel.ObjectStore} objectStore
@@ -1539,7 +1521,7 @@ Resources.IDBObjectStoreTreeElement = class extends Resources.BaseStorageTreeEle
*/
Resources.IDBIndexTreeElement = class extends Resources.BaseStorageTreeElement {
/**
- * @param {!Resources.ResourcesPanel} storagePanel
+ * @param {!Resources.ApplicationPanelSidebar} storagePanel
* @param {!Resources.IndexedDBModel} model
* @param {!Resources.IndexedDBModel.DatabaseId} databaseId
* @param {!Resources.IndexedDBModel.ObjectStore} objectStore
@@ -1622,7 +1604,7 @@ Resources.DOMStorageTreeElement = class extends Resources.BaseStorageTreeElement
*/
onselect(selectedByUser) {
super.onselect(selectedByUser);
- this._storagePanel._showDOMStorage(this._domStorage);
+ this._storagePanel.showDOMStorage(this._domStorage);
return false;
}
@@ -1643,7 +1625,7 @@ Resources.DOMStorageTreeElement = class extends Resources.BaseStorageTreeElement
Resources.CookieTreeElement = class extends Resources.BaseStorageTreeElement {
/**
- * @param {!Resources.ResourcesPanel} storagePanel
+ * @param {!Resources.ApplicationPanelSidebar} storagePanel
* @param {!SDK.ResourceTreeFrame} frame
* @param {string} cookieDomain
*/
@@ -1723,7 +1705,7 @@ Resources.ApplicationCacheManifestTreeElement = class extends Resources.BaseStor
*/
Resources.ApplicationCacheFrameTreeElement = class extends Resources.BaseStorageTreeElement {
/**
- * @param {!Resources.ResourcesPanel} storagePanel
+ * @param {!Resources.ApplicationPanelSidebar} storagePanel
* @param {!Protocol.Page.FrameId} frameId
* @param {string} manifestURL
*/

Powered by Google App Engine
This is Rietveld 408576698