Web Inspector: Rename NetworkTab / NetworkSidebar to LegacyNetwork*
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Sep 2017 22:23:51 +0000 (22:23 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Sep 2017 22:23:51 +0000 (22:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=176739

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-09-11
Reviewed by Matt Baker.

* UserInterface/Main.html:
* UserInterface/Views/LegacyNetworkSidebarPanel.css: Renamed from Source/WebInspectorUI/UserInterface/Views/NetworkSidebarPanel.css.
* UserInterface/Views/LegacyNetworkSidebarPanel.js: Renamed from Source/WebInspectorUI/UserInterface/Views/NetworkSidebarPanel.js.
* UserInterface/Views/LegacyNetworkTabContentView.js: Renamed from Source/WebInspectorUI/UserInterface/Views/NetworkTabContentView.js.
Rename resources.

* UserInterface/Base/Main.js:
(WI.contentLoaded):
* UserInterface/Views/NetworkGridContentView.js:
(WI.NetworkGridContentView):
(WI.NetworkGridContentView.prototype._networkTimelineRecordAdded):
* UserInterface/Views/TabBrowser.js:
(WI.TabBrowser.prototype.bestTabContentViewForRepresentedObject):
Update names at callsites.

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Main.js
Source/WebInspectorUI/UserInterface/Main.html
Source/WebInspectorUI/UserInterface/Views/LegacyNetworkSidebarPanel.css [moved from Source/WebInspectorUI/UserInterface/Views/NetworkSidebarPanel.css with 100% similarity]
Source/WebInspectorUI/UserInterface/Views/LegacyNetworkSidebarPanel.js [moved from Source/WebInspectorUI/UserInterface/Views/NetworkSidebarPanel.js with 84% similarity]
Source/WebInspectorUI/UserInterface/Views/LegacyNetworkTabContentView.js [moved from Source/WebInspectorUI/UserInterface/Views/NetworkTabContentView.js with 87% similarity]
Source/WebInspectorUI/UserInterface/Views/NetworkGridContentView.js
Source/WebInspectorUI/UserInterface/Views/TabBrowser.js

index d106127..719f3e3 100644 (file)
@@ -1,5 +1,27 @@
 2017-09-11  Joseph Pecoraro  <pecoraro@apple.com>
 
+        Web Inspector: Rename NetworkTab / NetworkSidebar to LegacyNetwork*
+        https://bugs.webkit.org/show_bug.cgi?id=176739
+
+        Reviewed by Matt Baker.
+
+        * UserInterface/Main.html:
+        * UserInterface/Views/LegacyNetworkSidebarPanel.css: Renamed from Source/WebInspectorUI/UserInterface/Views/NetworkSidebarPanel.css.
+        * UserInterface/Views/LegacyNetworkSidebarPanel.js: Renamed from Source/WebInspectorUI/UserInterface/Views/NetworkSidebarPanel.js.
+        * UserInterface/Views/LegacyNetworkTabContentView.js: Renamed from Source/WebInspectorUI/UserInterface/Views/NetworkTabContentView.js.
+        Rename resources.
+
+        * UserInterface/Base/Main.js:
+        (WI.contentLoaded):
+        * UserInterface/Views/NetworkGridContentView.js:
+        (WI.NetworkGridContentView):
+        (WI.NetworkGridContentView.prototype._networkTimelineRecordAdded):
+        * UserInterface/Views/TabBrowser.js:
+        (WI.TabBrowser.prototype.bestTabContentViewForRepresentedObject):
+        Update names at callsites.
+
+2017-09-11  Joseph Pecoraro  <pecoraro@apple.com>
+
         Web Inspector: Remove unused parameter to UIString
         https://bugs.webkit.org/show_bug.cgi?id=176738
 
index e264e90..a6c0458 100644 (file)
@@ -438,7 +438,7 @@ WI.contentLoaded = function()
         WI.DebuggerTabContentView,
         WI.ElementsTabContentView,
         WI.LayersTabContentView,
-        WI.NetworkTabContentView,
+        WI.LegacyNetworkTabContentView,
         WI.NewTabContentView,
         WI.RecordingTabContentView,
         WI.ResourcesTabContentView,
@@ -1002,9 +1002,9 @@ WI.showStorageTab = function()
 
 WI.showNetworkTab = function()
 {
-    var tabContentView = this.tabBrowser.bestTabContentViewForClass(WI.NetworkTabContentView);
+    var tabContentView = this.tabBrowser.bestTabContentViewForClass(WI.LegacyNetworkTabContentView);
     if (!tabContentView)
-        tabContentView = new WI.NetworkTabContentView;
+        tabContentView = new WI.LegacyNetworkTabContentView;
     this.tabBrowser.showTabForContentView(tabContentView);
 };
 
index e1504a6..48fe772 100644 (file)
     <link rel="stylesheet" href="Views/LayerTreeDetailsSidebarPanel.css">
     <link rel="stylesheet" href="Views/LayoutTimelineOverviewGraph.css">
     <link rel="stylesheet" href="Views/LayoutTimelineView.css">
+    <link rel="stylesheet" href="Views/LegacyNetworkSidebarPanel.css">
     <link rel="stylesheet" href="Views/LogContentView.css">
     <link rel="stylesheet" href="Views/LogIcon.css">
     <link rel="stylesheet" href="Views/MemoryCategoryView.css">
     <link rel="stylesheet" href="Views/NavigationBar.css">
     <link rel="stylesheet" href="Views/NavigationSidebarPanel.css">
     <link rel="stylesheet" href="Views/NetworkGridContentView.css">
-    <link rel="stylesheet" href="Views/NetworkSidebarPanel.css">
     <link rel="stylesheet" href="Views/NetworkTimelineOverviewGraph.css">
     <link rel="stylesheet" href="Views/NetworkTimelineView.css">
     <link rel="stylesheet" href="Views/NewTabContentView.css">
     <script src="Views/DOMDetailsSidebarPanel.js"></script>
     <script src="Views/FolderTreeElement.js"></script>
     <script src="Views/FolderizedTreeElement.js"></script>
-    <script src="Views/NetworkTabContentView.js"></script>
+    <script src="Views/LegacyNetworkTabContentView.js"></script>
     <script src="Views/NewTabContentView.js"></script>
     <script src="Views/ObjectTreeBaseTreeElement.js"></script>
     <script src="Views/SourceCodeTreeElement.js"></script>
     <script src="Views/LayoutTimelineDataGridNode.js"></script>
     <script src="Views/LayoutTimelineOverviewGraph.js"></script>
     <script src="Views/LayoutTimelineView.js"></script>
+    <script src="Views/LegacyNetworkSidebarPanel.js"></script>
     <script src="Views/LineChart.js"></script>
     <script src="Views/LogContentView.js"></script>
     <script src="Views/MemoryCategoryView.js"></script>
     <script src="Views/MultipleScopeBarItem.js"></script>
     <script src="Views/NavigationBar.js"></script>
     <script src="Views/NetworkGridContentView.js"></script>
-    <script src="Views/NetworkSidebarPanel.js"></script>
     <script src="Views/NetworkTimelineOverviewGraph.js"></script>
     <script src="Views/NetworkTimelineView.js"></script>
     <script src="Views/ObjectPreviewView.js"></script>
@@ -23,7 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WI.NetworkSidebarPanel = class NetworkSidebarPanel extends WI.NavigationSidebarPanel
+WI.LegacyNetworkSidebarPanel = class LegacyNetworkSidebarPanel extends WI.NavigationSidebarPanel
 {
     constructor(contentBrowser)
     {
@@ -47,7 +47,7 @@ WI.NetworkSidebarPanel = class NetworkSidebarPanel extends WI.NavigationSidebarP
     showDefaultContentView()
     {
         if (!this._networkGridView)
-            this._networkGridView = new WI.NetworkGridContentView(null, {networkSidebarPanel: this});
+            this._networkGridView = new WI.NetworkGridContentView(null, {legacyNetworkSidebarPanel: this});
 
         this.contentBrowser.showContentView(this._networkGridView);
     }
@@ -83,7 +83,7 @@ WI.NetworkSidebarPanel = class NetworkSidebarPanel extends WI.NavigationSidebarP
         for (let key in WI.Resource.Type) {
             let value = WI.Resource.Type[key];
             let scopeBarItem = new WI.ScopeBarItem(scopeItemPrefix + value, WI.Resource.displayNameForType(value, true));
-            scopeBarItem[WI.NetworkSidebarPanel.ResourceTypeSymbol] = value;
+            scopeBarItem[WI.LegacyNetworkSidebarPanel.ResourceTypeSymbol] = value;
             scopeBarItems.push(scopeBarItem);
         }
 
@@ -102,7 +102,7 @@ WI.NetworkSidebarPanel = class NetworkSidebarPanel extends WI.NavigationSidebarP
     {
         console.assert(cookie);
 
-        cookie[WI.NetworkSidebarPanel.ShowingNetworkGridContentViewCookieKey] = this.contentBrowser.currentContentView instanceof WI.NetworkGridContentView;
+        cookie[WI.LegacyNetworkSidebarPanel.ShowingNetworkGridContentViewCookieKey] = this.contentBrowser.currentContentView instanceof WI.NetworkGridContentView;
 
         super.saveStateToCookie(cookie);
     }
@@ -113,7 +113,7 @@ WI.NetworkSidebarPanel = class NetworkSidebarPanel extends WI.NavigationSidebarP
 
         // Don't call NavigationSidebarPanel.restoreStateFromCookie, because it tries to match based
         // on type selected tree element. This would cause the grid to be deselected.
-        if (cookie[WI.NetworkSidebarPanel.ShowingNetworkGridContentViewCookieKey])
+        if (cookie[WI.LegacyNetworkSidebarPanel.ShowingNetworkGridContentViewCookieKey])
             return;
 
         super.restoreStateFromCookie(cookie, relaxedMatchDelay);
@@ -138,13 +138,13 @@ WI.NetworkSidebarPanel = class NetworkSidebarPanel extends WI.NavigationSidebarP
         function match()
         {
             if (treeElement instanceof WI.FrameTreeElement)
-                return selectedScopeBarItem[WI.NetworkSidebarPanel.ResourceTypeSymbol] === WI.Resource.Type.Document;
+                return selectedScopeBarItem[WI.LegacyNetworkSidebarPanel.ResourceTypeSymbol] === WI.Resource.Type.Document;
 
             console.assert(treeElement instanceof WI.ResourceTreeElement, "Unknown treeElement", treeElement);
             if (!(treeElement instanceof WI.ResourceTreeElement))
                 return false;
 
-            return treeElement.resource.type === selectedScopeBarItem[WI.NetworkSidebarPanel.ResourceTypeSymbol];
+            return treeElement.resource.type === selectedScopeBarItem[WI.LegacyNetworkSidebarPanel.ResourceTypeSymbol];
         }
 
         var matched = match();
@@ -155,7 +155,7 @@ WI.NetworkSidebarPanel = class NetworkSidebarPanel extends WI.NavigationSidebarP
 
     treeElementAddedOrChanged(treeElement)
     {
-        if (treeElement.status && treeElement.status[WI.NetworkSidebarPanel.TreeElementStatusButtonSymbol] || !treeElement.treeOutline)
+        if (treeElement.status && treeElement.status[WI.LegacyNetworkSidebarPanel.TreeElementStatusButtonSymbol] || !treeElement.treeOutline)
             return;
 
         var fragment = document.createDocumentFragment();
@@ -166,12 +166,12 @@ WI.NetworkSidebarPanel = class NetworkSidebarPanel extends WI.NavigationSidebarP
         fragment.appendChild(closeButton.element);
 
         let goToButton = new WI.TreeElementStatusButton(WI.createGoToArrowButton());
-        goToButton[WI.NetworkSidebarPanel.TreeElementSymbol] = treeElement;
+        goToButton[WI.LegacyNetworkSidebarPanel.TreeElementSymbol] = treeElement;
         goToButton.addEventListener(WI.TreeElementStatusButton.Event.Clicked, this._treeElementGoToArrowWasClicked, this);
         fragment.appendChild(goToButton.element);
 
         treeElement.status = fragment;
-        treeElement.status[WI.NetworkSidebarPanel.TreeElementStatusButtonSymbol] = true;
+        treeElement.status[WI.LegacyNetworkSidebarPanel.TreeElementStatusButtonSymbol] = true;
     }
 
     // Private
@@ -202,7 +202,7 @@ WI.NetworkSidebarPanel = class NetworkSidebarPanel extends WI.NavigationSidebarP
     {
         this._clickedTreeElementGoToArrow = true;
 
-        let treeElement = event.target[WI.NetworkSidebarPanel.TreeElementSymbol];
+        let treeElement = event.target[WI.LegacyNetworkSidebarPanel.TreeElementSymbol];
         console.assert(treeElement instanceof WI.TreeElement);
 
         treeElement.select(true, true);
@@ -227,8 +227,8 @@ WI.NetworkSidebarPanel = class NetworkSidebarPanel extends WI.NavigationSidebarP
     }
 };
 
-WI.NetworkSidebarPanel.ResourceTypeSymbol = Symbol("resource-type");
-WI.NetworkSidebarPanel.TreeElementSymbol = Symbol("tree-element");
-WI.NetworkSidebarPanel.TreeElementStatusButtonSymbol = Symbol("tree-element-status-button");
+WI.LegacyNetworkSidebarPanel.ResourceTypeSymbol = Symbol("resource-type");
+WI.LegacyNetworkSidebarPanel.TreeElementSymbol = Symbol("tree-element");
+WI.LegacyNetworkSidebarPanel.TreeElementStatusButtonSymbol = Symbol("tree-element-status-button");
 
-WI.NetworkSidebarPanel.ShowingNetworkGridContentViewCookieKey = "network-sidebar-panel-showing-network-grid-content-view";
+WI.LegacyNetworkSidebarPanel.ShowingNetworkGridContentViewCookieKey = "network-sidebar-panel-showing-network-grid-content-view";
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WI.NetworkTabContentView = class NetworkTabContentView extends WI.ContentBrowserTabContentView
+WI.LegacyNetworkTabContentView = class LegacyNetworkTabContentView extends WI.ContentBrowserTabContentView
 {
     constructor(identifier)
     {
-        let {image, title} = WI.NetworkTabContentView.tabInfo();
+        let {image, title} = WI.LegacyNetworkTabContentView.tabInfo();
         let tabBarItem = new WI.GeneralTabBarItem(image, title);
         let detailsSidebarPanelConstructors = [WI.ResourceDetailsSidebarPanel, WI.ProbeDetailsSidebarPanel];
 
-        super(identifier || "network", "network", tabBarItem, WI.NetworkSidebarPanel, detailsSidebarPanelConstructors);
+        super(identifier || "network", "network", tabBarItem, WI.LegacyNetworkSidebarPanel, detailsSidebarPanelConstructors);
     }
 
     static tabInfo()
@@ -51,7 +51,7 @@ WI.NetworkTabContentView = class NetworkTabContentView extends WI.ContentBrowser
 
     get type()
     {
-        return WI.NetworkTabContentView.Type;
+        return WI.LegacyNetworkTabContentView.Type;
     }
 
     canShowRepresentedObject(representedObject)
@@ -70,4 +70,4 @@ WI.NetworkTabContentView = class NetworkTabContentView extends WI.ContentBrowser
     }
 };
 
-WI.NetworkTabContentView.Type = "network";
+WI.LegacyNetworkTabContentView.Type = "network";
index 47c1eba..5abc841 100644 (file)
@@ -28,13 +28,13 @@ WI.NetworkGridContentView = class NetworkGridContentView extends WI.ContentView
     constructor(representedObject, extraArguments)
     {
         console.assert(extraArguments);
-        console.assert(extraArguments.networkSidebarPanel instanceof WI.NetworkSidebarPanel);
+        console.assert(extraArguments.legacyNetworkSidebarPanel instanceof WI.LegacyNetworkSidebarPanel);
 
         super(representedObject);
 
         WI.Frame.addEventListener(WI.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
 
-        this._networkSidebarPanel = extraArguments.networkSidebarPanel;
+        this._networkSidebarPanel = extraArguments.legacyNetworkSidebarPanel;
 
         this._contentTreeOutline = this._networkSidebarPanel.contentTreeOutline;
         this._contentTreeOutline.addEventListener(WI.TreeOutline.Event.SelectionDidChange, this._treeSelectionDidChange, this);
@@ -371,7 +371,7 @@ WI.NetworkGridContentView = class NetworkGridContentView extends WI.ContentView
             this._startTime = this._endTime = resourceTimelineRecord.startTime;
 
         // FIXME: <https://webkit.org/b/153634> Web Inspector: some background tabs think they are the foreground tab and do unnecessary work
-        if (!(WI.tabBrowser.selectedTabContentView instanceof WI.NetworkTabContentView))
+        if (!(WI.tabBrowser.selectedTabContentView instanceof WI.LegacyNetworkTabContentView))
             return;
 
         this._startUpdatingCurrentTime();
index 9d1c176..6962f0b 100644 (file)
@@ -126,7 +126,7 @@ WI.TabBrowser = class TabBrowser extends WI.View
             if (options.ignoreSearchTab && tabContentView instanceof WI.SearchTabContentView)
                 continue;
 
-            if (options.ignoreNetworkTab && tabContentView instanceof WI.NetworkTabContentView)
+            if (options.ignoreNetworkTab && tabContentView instanceof WI.LegacyNetworkTabContentView)
                 continue;
 
             if (tabContentView.canShowRepresentedObject(representedObject))