Changeset 183642 in webkit


Ignore:
Timestamp:
Apr 30, 2015 1:03:57 PM (9 years ago)
Author:
timothy@apple.com
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.

Location:
trunk/Source/WebInspectorUI
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r183633 r183642  
     12015-04-30  Timothy Hatcher  <timothy@apple.com>
     2
     3        Web Inspector: Scope Chain sidebar should be selected immediately when paused
     4        https://bugs.webkit.org/show_bug.cgi?id=144352
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        * UserInterface/Base/Main.js:
     9        (WebInspector.showDebuggerTab): Added showScopeChainDetailsSidebarPanel argument.
     10        (WebInspector._debuggerDidPause): Pass true for showScopeChainDetailsSidebarPanel.
     11        * UserInterface/Views/ContentBrowserTabContentView.js:
     12        (WebInspector.ContentBrowserTabContentView): Wire the event to showDetailsSidebarPanels instead of
     13        _contentBrowserRepresentedObjectsDidChange, allowing subclasses to do work during the event.
     14        (WebInspector.ContentBrowserTabContentView.prototype.showDetailsSidebarPanels): Moved content of
     15        _contentBrowserRepresentedObjectsDidChange here.
     16        (WebInspector.ContentBrowserTabContentView.prototype._contentBrowserRepresentedObjectsDidChange): Deleted.
     17        * UserInterface/Views/DebuggerTabContentView.js:
     18        (WebInspector.DebuggerTabContentView.prototype.showDetailsSidebarPanels): Added. Show the scope sidebar panel
     19        if it is available and it was requested by showScopeChainDetailsSidebarPanel().
     20        (WebInspector.DebuggerTabContentView.prototype.showScopeChainDetailsSidebarPanel): Added.
     21
    1222015-04-30  Andres Gomez  <agomez@igalia.com>
    223
  • trunk/Source/WebInspectorUI/UserInterface/Base/Main.js

    r183625 r183642  
    739739};
    740740
    741 WebInspector.showDebuggerTab = function(breakpointToSelect)
     741WebInspector.showDebuggerTab = function(breakpointToSelect, showScopeChainDetailsSidebarPanel)
    742742{
    743743    var tabContentView = this.tabBrowser.bestTabContentViewForClass(WebInspector.DebuggerTabContentView);
     
    747747    if (breakpointToSelect instanceof WebInspector.Breakpoint)
    748748        tabContentView.revealAndSelectBreakpoint(breakpointToSelect);
     749
     750    if (showScopeChainDetailsSidebarPanel)
     751        tabContentView.showScopeChainDetailsSidebarPanel();
    749752
    750753    this.tabBrowser.showTabForContentView(tabContentView);
     
    10691072WebInspector._debuggerDidPause = function(event)
    10701073{
    1071     this.showDebuggerTab();
     1074    this.showDebuggerTab(null, true);
    10721075
    10731076    this._dashboardContainer.showDashboardViewForRepresentedObject(this.dashboardManager.dashboards.debugger);
  • trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowserTabContentView.js

    r183375 r183642  
    3939
    4040    this._contentBrowser = contentBrowser;
    41     this._contentBrowser.addEventListener(WebInspector.ContentBrowser.Event.CurrentRepresentedObjectsDidChange, this._contentBrowserRepresentedObjectsDidChange, this);
     41    this._contentBrowser.addEventListener(WebInspector.ContentBrowser.Event.CurrentRepresentedObjectsDidChange, this.showDetailsSidebarPanels, this);
    4242    this._contentBrowser.addEventListener(WebInspector.ContentBrowser.Event.CurrentContentViewDidChange, this._contentBrowserCurrentContentViewDidChange, this);
    4343
     
    128128
    129129    showDetailsSidebarPanels: function()
    130     {
    131         this._contentBrowserRepresentedObjectsDidChange();
    132     },
    133 
    134     showRepresentedObject: function(representedObject, cookie)
    135     {
    136         this.contentBrowser.showContentViewForRepresentedObject(representedObject, cookie);
    137     },
    138 
    139     // ContentBrowser Delegate
    140 
    141     contentBrowserTreeElementForRepresentedObject: function(contentBrowser, representedObject)
    142     {
    143         if (this.navigationSidebarPanel)
    144             return this.navigationSidebarPanel.treeElementForRepresentedObject(representedObject);
    145         return null;
    146     },
    147 
    148     // Private
    149 
    150     _navigationSidebarCollapsedStateDidChange: function(event)
    151     {
    152         this._showNavigationSidebarItem.activated = !WebInspector.navigationSidebar.collapsed;
    153     },
    154 
    155     _detailsSidebarCollapsedStateDidChange: function(event)
    156     {
    157         if (!this.visible)
    158             return;
    159 
    160         this._showDetailsSidebarItem.activated = !WebInspector.detailsSidebar.collapsed;
    161         this._showDetailsSidebarItem.enabled = WebInspector.detailsSidebar.sidebarPanels.length;
    162 
    163         if (this._ignoreDetailsSidebarPanelCollapsedEvent)
    164             return;
    165 
    166         this.detailsSidebarCollapsedSetting.value = WebInspector.detailsSidebar.collapsed;
    167     },
    168 
    169     _detailsSidebarPanelSelected: function(event)
    170     {
    171         if (!this.visible)
    172             return;
    173 
    174         this._showDetailsSidebarItem.enabled = WebInspector.detailsSidebar.sidebarPanels.length;
    175 
    176         if (!WebInspector.detailsSidebar.selectedSidebarPanel || this._ignoreDetailsSidebarPanelSelectedEvent)
    177             return;
    178 
    179         this._lastSelectedDetailsSidebarPanelSetting.value = WebInspector.detailsSidebar.selectedSidebarPanel.identifier;
    180     },
    181 
    182     _contentBrowserRepresentedObjectsDidChange: function()
    183130    {
    184131        if (!this.visible)
     
    232179    },
    233180
     181    showRepresentedObject: function(representedObject, cookie)
     182    {
     183        this.contentBrowser.showContentViewForRepresentedObject(representedObject, cookie);
     184    },
     185
     186    // ContentBrowser Delegate
     187
     188    contentBrowserTreeElementForRepresentedObject: function(contentBrowser, representedObject)
     189    {
     190        if (this.navigationSidebarPanel)
     191            return this.navigationSidebarPanel.treeElementForRepresentedObject(representedObject);
     192        return null;
     193    },
     194
     195    // Private
     196
     197    _navigationSidebarCollapsedStateDidChange: function(event)
     198    {
     199        this._showNavigationSidebarItem.activated = !WebInspector.navigationSidebar.collapsed;
     200    },
     201
     202    _detailsSidebarCollapsedStateDidChange: function(event)
     203    {
     204        if (!this.visible)
     205            return;
     206
     207        this._showDetailsSidebarItem.activated = !WebInspector.detailsSidebar.collapsed;
     208        this._showDetailsSidebarItem.enabled = WebInspector.detailsSidebar.sidebarPanels.length;
     209
     210        if (this._ignoreDetailsSidebarPanelCollapsedEvent)
     211            return;
     212
     213        this.detailsSidebarCollapsedSetting.value = WebInspector.detailsSidebar.collapsed;
     214    },
     215
     216    _detailsSidebarPanelSelected: function(event)
     217    {
     218        if (!this.visible)
     219            return;
     220
     221        this._showDetailsSidebarItem.enabled = WebInspector.detailsSidebar.sidebarPanels.length;
     222
     223        if (!WebInspector.detailsSidebar.selectedSidebarPanel || this._ignoreDetailsSidebarPanelSelectedEvent)
     224            return;
     225
     226        this._lastSelectedDetailsSidebarPanelSetting.value = WebInspector.detailsSidebar.selectedSidebarPanel.identifier;
     227    },
     228
    234229    _contentBrowserCurrentContentViewDidChange: function(event)
    235230    {
  • trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerTabContentView.js

    r183333 r183642  
    5757    },
    5858
     59    showDetailsSidebarPanels: function()
     60    {
     61        WebInspector.ContentBrowserTabContentView.prototype.showDetailsSidebarPanels.call(this);
     62
     63        if (!this._showScopeChainDetailsSidebarPanel || !WebInspector.scopeChainDetailsSidebarPanel.parentSidebar)
     64            return;
     65
     66        WebInspector.scopeChainDetailsSidebarPanel.show();
     67
     68        this._showScopeChainDetailsSidebarPanel = false;
     69    },
     70
     71    showScopeChainDetailsSidebarPanel: function()
     72    {
     73        this._showScopeChainDetailsSidebarPanel = true;
     74    },
     75
    5976    revealAndSelectBreakpoint: function(breakpoint)
    6077    {
Note: See TracChangeset for help on using the changeset viewer.