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

Unified Diff: Source/devtools/front_end/resources/ResourcesPanel.js

Issue 720223002: DevTools: only allow status bar items in status bars. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaselined Created 6 years, 1 month 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: Source/devtools/front_end/resources/ResourcesPanel.js
diff --git a/Source/devtools/front_end/resources/ResourcesPanel.js b/Source/devtools/front_end/resources/ResourcesPanel.js
index 97037c1fef41276f9da8e3d2002316839e682774..73f0c9038e4568bd6b52e596b9d17afb7a976858 100644
--- a/Source/devtools/front_end/resources/ResourcesPanel.js
+++ b/Source/devtools/front_end/resources/ResourcesPanel.js
@@ -70,9 +70,9 @@ WebInspector.ResourcesPanel = function()
}
var mainView = new WebInspector.VBox();
- this.storageViews = mainView.element.createChild("div", "resources-main diff-container");
- var statusBarContainer = mainView.element.createChild("div", "resources-status-bar");
- this.storageViewStatusBarItemsContainer = statusBarContainer.createChild("div", "status-bar");
+ this.storageViews = mainView.element.createChild("div", "vbox flex-auto");
+ this._storageViewStatusBar = new WebInspector.StatusBar(mainView.element);
+ this._storageViewStatusBar.element.classList.add("resources-status-bar");
mainView.show(this.mainElement());
/** @type {!Map.<!WebInspector.Database, !Object.<string, !WebInspector.DatabaseTableView>>} */
@@ -232,7 +232,7 @@ WebInspector.ResourcesPanel.prototype = {
if (this.visibleView && !(this.visibleView instanceof WebInspector.StorageCategoryView))
this.visibleView.detach();
- this.storageViewStatusBarItemsContainer.removeChildren();
+ this._storageViewStatusBar.removeStatusBarItems();
if (this.sidebarTree.selectedTreeElement)
this.sidebarTree.selectedTreeElement.deselect();
@@ -620,10 +620,10 @@ WebInspector.ResourcesPanel.prototype = {
view.show(this.storageViews);
this.visibleView = view;
- this.storageViewStatusBarItemsContainer.removeChildren();
- var statusBarItems = view.statusBarItems || [];
- for (var i = 0; i < statusBarItems.length; ++i)
- this.storageViewStatusBarItemsContainer.appendChild(statusBarItems[i]);
+ this._storageViewStatusBar.removeStatusBarItems();
+ var statusBarItems = view.statusBarItems ? view.statusBarItems() : null;
+ for (var i = 0; statusBarItems && i < statusBarItems.length; ++i)
+ this._storageViewStatusBar.appendStatusBarItem(statusBarItems[i]);
},
closeVisibleView: function()
@@ -2154,6 +2154,14 @@ WebInspector.StorageCategoryView = function()
}
WebInspector.StorageCategoryView.prototype = {
+ /**
+ * @return {!Array.<!WebInspector.StatusBarItem>}
+ */
+ statusBarItems: function()
+ {
+ return [];
+ },
+
setText: function(text)
{
this._emptyView.text = text;
« no previous file with comments | « Source/devtools/front_end/resources/IndexedDBViews.js ('k') | Source/devtools/front_end/resources/indexedDBViews.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698