Web Inspector: Allow closing and reopening the Resources tab
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 May 2015 09:41:26 +0000 (09:41 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 May 2015 09:41:26 +0000 (09:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=144513

Reviewed by Joseph Pecoraro.

* UserInterface/Base/Main.js:
(WebInspector._updateNewTabButtonState):
* UserInterface/Views/NewTabContentView.js:
(WebInspector.NewTabContentView):
* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel):
(WebInspector.ResourceSidebarPanel.prototype.closed):
* UserInterface/Views/ResourcesTabContentView.js:
(WebInspector.ResourcesTabContentView):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183714 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Main.js
Source/WebInspectorUI/UserInterface/Views/NewTabContentView.js
Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/ResourcesTabContentView.js

index 84f0cb5..3947d50 100644 (file)
@@ -1,5 +1,22 @@
 2015-05-02  Timothy Hatcher  <timothy@apple.com>
 
+        Web Inspector: Allow closing and reopening the Resources tab
+        https://bugs.webkit.org/show_bug.cgi?id=144513
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Base/Main.js:
+        (WebInspector._updateNewTabButtonState):
+        * UserInterface/Views/NewTabContentView.js:
+        (WebInspector.NewTabContentView):
+        * UserInterface/Views/ResourceSidebarPanel.js:
+        (WebInspector.ResourceSidebarPanel):
+        (WebInspector.ResourceSidebarPanel.prototype.closed):
+        * UserInterface/Views/ResourcesTabContentView.js:
+        (WebInspector.ResourcesTabContentView):
+
+2015-05-02  Timothy Hatcher  <timothy@apple.com>
+
         Web Inspector: REGRESSION: Resources section doesn't update after changes are made to a local file
         https://bugs.webkit.org/show_bug.cgi?id=144512
 
index 5d63a1f..28b5715 100644 (file)
@@ -431,7 +431,7 @@ WebInspector._rememberOpenTabs = function()
 WebInspector._updateNewTabButtonState = function(event)
 {
     var newTabAllowed = this.isNewTabWithTypeAllowed(WebInspector.ConsoleTabContentView.Type) || this.isNewTabWithTypeAllowed(WebInspector.ElementsTabContentView.Type)
-         || this.isNewTabWithTypeAllowed(WebInspector.StorageTabContentView.Type);
+         || this.isNewTabWithTypeAllowed(WebInspector.ResourcesTabContentView.Type) || this.isNewTabWithTypeAllowed(WebInspector.StorageTabContentView.Type);
     this.tabBar.newTabItem.disabled = !newTabAllowed;
 };
 
index 286dd0c..ff3e8f8 100644 (file)
@@ -31,6 +31,7 @@ WebInspector.NewTabContentView = function(identifier)
 
     var allowedNewTabs = [
         {image: "Images/Elements.svg", title: WebInspector.UIString("Elements"), type: WebInspector.ElementsTabContentView.Type},
+        {image: "Images/Resources.svg", title: WebInspector.UIString("Resources"), type: WebInspector.ResourcesTabContentView.Type},
         {image: "Images/Storage.svg", title: WebInspector.UIString("Storage"), type: WebInspector.StorageTabContentView.Type},
         {image: "Images/Console.svg", title: WebInspector.UIString("Console"), type: WebInspector.ConsoleTabContentView.Type}
     ];
index bf4ef72..29b4739 100644 (file)
@@ -47,10 +47,21 @@ WebInspector.ResourceSidebarPanel = class ResourceSidebarPanel extends WebInspec
 
         if (WebInspector.debuggableType === WebInspector.DebuggableType.JavaScript)
             this.contentTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.HideDisclosureButtonsStyleClassName);
+
+        if (WebInspector.frameResourceManager.mainFrame)
+            this._mainFrameMainResourceDidChange(WebInspector.frameResourceManager.mainFrame);
     }
 
     // Public
 
+    closed()
+    {
+        WebInspector.Frame.removeEventListener(null, null, this);
+        WebInspector.frameResourceManager.removeEventListener(null, null, this);
+        WebInspector.debuggerManager.removeEventListener(null, null, this);
+        WebInspector.notifications.removeEventListener(null, null, this);
+    }
+
     showDefaultContentView()
     {
         if (WebInspector.frameResourceManager.mainFrame) {
index eb4a227..95412e0 100644 (file)
@@ -33,9 +33,6 @@ WebInspector.ResourcesTabContentView = function(identifier)
     if (WebInspector.layerTreeDetailsSidebarPanel)
         detailsSidebarPanels.push(WebInspector.layerTreeDetailsSidebarPanel);
 
-    // FIME: Until ResourceSidebarPanel supports instantiating after inspector launch, disable closing.
-    tabBarItem.hideCloseButton = true;
-
     WebInspector.ContentBrowserTabContentView.call(this, identifier || "resources", "resources", tabBarItem, WebInspector.ResourceSidebarPanel, detailsSidebarPanels);
 };