Title: [183642] trunk/Source/WebInspectorUI
Revision
183642
Author
timo...@apple.com
Date
2015-04-30 13:03:57 -0700 (Thu, 30 Apr 2015)

Log Message

Web Inspector: Scope Chain sidebar should be selected immediately when paused
https://bugs.webkit.org/show_bug.cgi?id=144352

Reviewed by Joseph Pecoraro.

* UserInterface/Base/Main.js:
(WebInspector.showDebuggerTab): Added showScopeChainDetailsSidebarPanel argument.
(WebInspector._debuggerDidPause): Pass true for showScopeChainDetailsSidebarPanel.
* UserInterface/Views/ContentBrowserTabContentView.js:
(WebInspector.ContentBrowserTabContentView): Wire the event to showDetailsSidebarPanels instead of
_contentBrowserRepresentedObjectsDidChange, allowing subclasses to do work during the event.
(WebInspector.ContentBrowserTabContentView.prototype.showDetailsSidebarPanels): Moved content of
_contentBrowserRepresentedObjectsDidChange here.
(WebInspector.ContentBrowserTabContentView.prototype._contentBrowserRepresentedObjectsDidChange): Deleted.
* UserInterface/Views/DebuggerTabContentView.js:
(WebInspector.DebuggerTabContentView.prototype.showDetailsSidebarPanels): Added. Show the scope sidebar panel
if it is available and it was requested by showScopeChainDetailsSidebarPanel().
(WebInspector.DebuggerTabContentView.prototype.showScopeChainDetailsSidebarPanel): Added.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (183641 => 183642)


--- trunk/Source/WebInspectorUI/ChangeLog	2015-04-30 20:01:18 UTC (rev 183641)
+++ trunk/Source/WebInspectorUI/ChangeLog	2015-04-30 20:03:57 UTC (rev 183642)
@@ -1,3 +1,24 @@
+2015-04-30  Timothy Hatcher  <timo...@apple.com>
+
+        Web Inspector: Scope Chain sidebar should be selected immediately when paused
+        https://bugs.webkit.org/show_bug.cgi?id=144352
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Base/Main.js:
+        (WebInspector.showDebuggerTab): Added showScopeChainDetailsSidebarPanel argument.
+        (WebInspector._debuggerDidPause): Pass true for showScopeChainDetailsSidebarPanel.
+        * UserInterface/Views/ContentBrowserTabContentView.js:
+        (WebInspector.ContentBrowserTabContentView): Wire the event to showDetailsSidebarPanels instead of
+        _contentBrowserRepresentedObjectsDidChange, allowing subclasses to do work during the event.
+        (WebInspector.ContentBrowserTabContentView.prototype.showDetailsSidebarPanels): Moved content of
+        _contentBrowserRepresentedObjectsDidChange here.
+        (WebInspector.ContentBrowserTabContentView.prototype._contentBrowserRepresentedObjectsDidChange): Deleted.
+        * UserInterface/Views/DebuggerTabContentView.js:
+        (WebInspector.DebuggerTabContentView.prototype.showDetailsSidebarPanels): Added. Show the scope sidebar panel
+        if it is available and it was requested by showScopeChainDetailsSidebarPanel().
+        (WebInspector.DebuggerTabContentView.prototype.showScopeChainDetailsSidebarPanel): Added.
+
 2015-04-30  Andres Gomez  <ago...@igalia.com>
 
         [GTK] Web Inspector: New Images for ObjectTreeView - Setter

Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (183641 => 183642)


--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js	2015-04-30 20:01:18 UTC (rev 183641)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js	2015-04-30 20:03:57 UTC (rev 183642)
@@ -738,7 +738,7 @@
     this.tabBrowser.showTabForContentView(tabContentView);
 };
 
-WebInspector.showDebuggerTab = function(breakpointToSelect)
+WebInspector.showDebuggerTab = function(breakpointToSelect, showScopeChainDetailsSidebarPanel)
 {
     var tabContentView = this.tabBrowser.bestTabContentViewForClass(WebInspector.DebuggerTabContentView);
     if (!tabContentView)
@@ -747,6 +747,9 @@
     if (breakpointToSelect instanceof WebInspector.Breakpoint)
         tabContentView.revealAndSelectBreakpoint(breakpointToSelect);
 
+    if (showScopeChainDetailsSidebarPanel)
+        tabContentView.showScopeChainDetailsSidebarPanel();
+
     this.tabBrowser.showTabForContentView(tabContentView);
 };
 
@@ -1068,7 +1071,7 @@
 
 WebInspector._debuggerDidPause = function(event)
 {
-    this.showDebuggerTab();
+    this.showDebuggerTab(null, true);
 
     this._dashboardContainer.showDashboardViewForRepresentedObject(this.dashboardManager.dashboards.debugger);
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowserTabContentView.js (183641 => 183642)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowserTabContentView.js	2015-04-30 20:01:18 UTC (rev 183641)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowserTabContentView.js	2015-04-30 20:03:57 UTC (rev 183642)
@@ -38,7 +38,7 @@
     this._lastSelectedDetailsSidebarPanelSetting = new WebInspector.Setting(identifier + "-last-selected-details-sidebar-panel", null);
 
     this._contentBrowser = contentBrowser;
-    this._contentBrowser.addEventListener(WebInspector.ContentBrowser.Event.CurrentRepresentedObjectsDidChange, this._contentBrowserRepresentedObjectsDidChange, this);
+    this._contentBrowser.addEventListener(WebInspector.ContentBrowser.Event.CurrentRepresentedObjectsDidChange, this.showDetailsSidebarPanels, this);
     this._contentBrowser.addEventListener(WebInspector.ContentBrowser.Event.CurrentContentViewDidChange, this._contentBrowserCurrentContentViewDidChange, this);
 
     if (navigationSidebarPanel) {
@@ -128,62 +128,9 @@
 
     showDetailsSidebarPanels: function()
     {
-        this._contentBrowserRepresentedObjectsDidChange();
-    },
-
-    showRepresentedObject: function(representedObject, cookie)
-    {
-        this.contentBrowser.showContentViewForRepresentedObject(representedObject, cookie);
-    },
-
-    // ContentBrowser Delegate
-
-    contentBrowserTreeElementForRepresentedObject: function(contentBrowser, representedObject)
-    {
-        if (this.navigationSidebarPanel)
-            return this.navigationSidebarPanel.treeElementForRepresentedObject(representedObject);
-        return null;
-    },
-
-    // Private
-
-    _navigationSidebarCollapsedStateDidChange: function(event)
-    {
-        this._showNavigationSidebarItem.activated = !WebInspector.navigationSidebar.collapsed;
-    },
-
-    _detailsSidebarCollapsedStateDidChange: function(event)
-    {
         if (!this.visible)
             return;
 
-        this._showDetailsSidebarItem.activated = !WebInspector.detailsSidebar.collapsed;
-        this._showDetailsSidebarItem.enabled = WebInspector.detailsSidebar.sidebarPanels.length;
-
-        if (this._ignoreDetailsSidebarPanelCollapsedEvent)
-            return;
-
-        this.detailsSidebarCollapsedSetting.value = WebInspector.detailsSidebar.collapsed;
-    },
-
-    _detailsSidebarPanelSelected: function(event)
-    {
-        if (!this.visible)
-            return;
-
-        this._showDetailsSidebarItem.enabled = WebInspector.detailsSidebar.sidebarPanels.length;
-
-        if (!WebInspector.detailsSidebar.selectedSidebarPanel || this._ignoreDetailsSidebarPanelSelectedEvent)
-            return;
-
-        this._lastSelectedDetailsSidebarPanelSetting.value = WebInspector.detailsSidebar.selectedSidebarPanel.identifier;
-    },
-
-    _contentBrowserRepresentedObjectsDidChange: function()
-    {
-        if (!this.visible)
-            return;
-
         var currentRepresentedObjects = this._contentBrowser.currentRepresentedObjects;
         var currentSidebarPanels = WebInspector.detailsSidebar.sidebarPanels;
         var wasSidebarEmpty = !currentSidebarPanels.length;
@@ -231,6 +178,54 @@
         this._showDetailsSidebarItem.enabled = WebInspector.detailsSidebar.sidebarPanels.length;
     },
 
+    showRepresentedObject: function(representedObject, cookie)
+    {
+        this.contentBrowser.showContentViewForRepresentedObject(representedObject, cookie);
+    },
+
+    // ContentBrowser Delegate
+
+    contentBrowserTreeElementForRepresentedObject: function(contentBrowser, representedObject)
+    {
+        if (this.navigationSidebarPanel)
+            return this.navigationSidebarPanel.treeElementForRepresentedObject(representedObject);
+        return null;
+    },
+
+    // Private
+
+    _navigationSidebarCollapsedStateDidChange: function(event)
+    {
+        this._showNavigationSidebarItem.activated = !WebInspector.navigationSidebar.collapsed;
+    },
+
+    _detailsSidebarCollapsedStateDidChange: function(event)
+    {
+        if (!this.visible)
+            return;
+
+        this._showDetailsSidebarItem.activated = !WebInspector.detailsSidebar.collapsed;
+        this._showDetailsSidebarItem.enabled = WebInspector.detailsSidebar.sidebarPanels.length;
+
+        if (this._ignoreDetailsSidebarPanelCollapsedEvent)
+            return;
+
+        this.detailsSidebarCollapsedSetting.value = WebInspector.detailsSidebar.collapsed;
+    },
+
+    _detailsSidebarPanelSelected: function(event)
+    {
+        if (!this.visible)
+            return;
+
+        this._showDetailsSidebarItem.enabled = WebInspector.detailsSidebar.sidebarPanels.length;
+
+        if (!WebInspector.detailsSidebar.selectedSidebarPanel || this._ignoreDetailsSidebarPanelSelectedEvent)
+            return;
+
+        this._lastSelectedDetailsSidebarPanelSetting.value = WebInspector.detailsSidebar.selectedSidebarPanel.identifier;
+    },
+
     _contentBrowserCurrentContentViewDidChange: function(event)
     {
         var currentContentView = this._contentBrowser.currentContentView;

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerTabContentView.js (183641 => 183642)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerTabContentView.js	2015-04-30 20:01:18 UTC (rev 183641)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerTabContentView.js	2015-04-30 20:03:57 UTC (rev 183642)
@@ -56,6 +56,23 @@
         return representedObject.type === WebInspector.Resource.Type.Document || representedObject.type === WebInspector.Resource.Type.Script;
     },
 
+    showDetailsSidebarPanels: function()
+    {
+        WebInspector.ContentBrowserTabContentView.prototype.showDetailsSidebarPanels.call(this);
+
+        if (!this._showScopeChainDetailsSidebarPanel || !WebInspector.scopeChainDetailsSidebarPanel.parentSidebar)
+            return;
+
+        WebInspector.scopeChainDetailsSidebarPanel.show();
+
+        this._showScopeChainDetailsSidebarPanel = false;
+    },
+
+    showScopeChainDetailsSidebarPanel: function()
+    {
+        this._showScopeChainDetailsSidebarPanel = true;
+    },
+
     revealAndSelectBreakpoint: function(breakpoint)
     {
         console.assert(breakpoint instanceof WebInspector.Breakpoint);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to