Changeset 183331 in webkit


Ignore:
Timestamp:
Apr 25, 2015, 6:20:59 PM (10 years ago)
Author:
timothy@apple.com
Message:

Web Inspector: Make showing a content view work in the tab world
https://bugs.webkit.org/show_bug.cgi?id=144110

Reviewed by Joseph Pecoraro.

  • UserInterface/Base/Main.js:

(WebInspector.loaded):
(WebInspector.hideSplitConsole):
(WebInspector.showSourceCodeLocation):
(WebInspector.showOriginalUnformattedSourceCodeLocation):
(WebInspector.showOriginalOrFormattedSourceCodeLocation):
(WebInspector.showOriginalOrFormattedSourceCodeTextRange):
(WebInspector.showResourceRequest):
(WebInspector.debuggerToggleBreakpoints):
(WebInspector.debuggerPauseResumeToggle):
(WebInspector.debuggerStepOver):
(WebInspector.debuggerStepInto):
(WebInspector.debuggerStepOut):
(WebInspector._focusChanged):
(WebInspector._mouseWasClicked):
(WebInspector._dragOver):
(WebInspector._captureDidStart):
(WebInspector._debuggerDidPause):
(WebInspector._debuggerDidResume):
(WebInspector._frameWasAdded):
(WebInspector._undock):
(WebInspector._updateDockNavigationItems):

  • UserInterface/Models/Breakpoint.js:

(WebInspector.Breakpoint.prototype.appendContextMenuItems.revealOriginalSourceCodeLocation):
(WebInspector.Breakpoint.prototype.appendContextMenuItems):

  • UserInterface/Protocol/InspectorFrontendAPI.js:

(InspectorFrontendAPI.showMainResourceForFrame):

  • UserInterface/Views/CSSStyleDeclarationTextEditor.js:

(WebInspector.CSSStyleDeclarationTextEditor.prototype.tokenTrackingControllerHighlightedRangeWasClicked):

  • UserInterface/Views/ComputedStyleDetailsPanel.js:

(WebInspector.ComputedStyleDetailsPanel.prototype._goToRegionFlowArrowWasClicked):
(WebInspector.ComputedStyleDetailsPanel.prototype._goToContentFlowArrowWasClicked):
(WebInspector.ComputedStyleDetailsPanel):

  • UserInterface/Views/ContentBrowser.js:

(WebInspector.ContentBrowser.prototype.updateHierarchicalPathForCurrentContentView):

  • UserInterface/Views/ContentView.js:

(WebInspector.ContentView):

  • UserInterface/Views/DOMTreeContentView.js:

(WebInspector.DOMTreeContentView.prototype.restoreFromCookie):

  • UserInterface/Views/DOMTreeDataGridNode.js:

(WebInspector.DOMTreeDataGridNode.prototype._goToArrowWasClicked):

  • UserInterface/Views/DebuggerSidebarPanel.js:

(WebInspector.DebuggerSidebarPanel.prototype.showDefaultContentView):
(WebInspector.DebuggerSidebarPanel.prototype._addTreeElementForSourceCodeToContentTreeOutline):
(WebInspector.DebuggerSidebarPanel.prototype._treeElementSelected):
(WebInspector.DebuggerSidebarPanel.prototype._addIssue):
(WebInspector.DebuggerSidebarPanel.prototype._handleIssueAdded):

  • UserInterface/Views/LayerTreeDataGridNode.js:

(WebInspector.LayerTreeDataGridNode.prototype._goToArrowWasClicked):

  • UserInterface/Views/LayoutTimelineView.js:

(WebInspector.LayoutTimelineView.prototype._treeElementSelected):

  • UserInterface/Views/NavigationSidebarPanel.js:

(WebInspector.NavigationSidebarPanel.prototype.get contentBrowser):
(WebInspector.NavigationSidebarPanel.prototype.set contentBrowser):
(WebInspector.NavigationSidebarPanel.prototype._updateFilter):

  • UserInterface/Views/NetworkTimelineView.js:

(WebInspector.NetworkTimelineView.prototype._treeElementSelected):

  • UserInterface/Views/ObjectTreeBaseTreeElement.js:

(WebInspector.ObjectTreeBaseTreeElement.prototype._appendMenusItemsForObject):
(WebInspector.ObjectTreeBaseTreeElement):

  • UserInterface/Views/OverviewTimelineView.js:

(WebInspector.OverviewTimelineView.prototype._treeElementSelected):

  • UserInterface/Views/ResourceDetailsSidebarPanel.js:

(WebInspector.ResourceDetailsSidebarPanel.prototype._goToRequestDataClicked):

  • UserInterface/Views/ResourceSidebarPanel.js:

(WebInspector.ResourceSidebarPanel):
(WebInspector.ResourceSidebarPanel.prototype.showDefaultContentView):
(WebInspector.ResourceSidebarPanel.prototype._mainFrameDidChange):
(WebInspector.ResourceSidebarPanel.prototype._mainFrameMainResourceDidChange.delayedWork):
(WebInspector.ResourceSidebarPanel.prototype._mainFrameMainResourceDidChange):
(WebInspector.ResourceSidebarPanel.prototype._treeElementSelected):
(WebInspector.ResourceSidebarPanel.prototype._storageCleared):

  • UserInterface/Views/ResourceTimelineDataGridNode.js:

(WebInspector.ResourceTimelineDataGridNode.prototype._goToResource):

  • UserInterface/Views/ScriptTimelineView.js:

(WebInspector.ScriptTimelineView.prototype._treeElementSelected):

  • UserInterface/Views/SourceCodeTextEditor.js:

(WebInspector.SourceCodeTextEditor.prototype.tokenTrackingControllerHighlightedRangeWasClicked):

  • UserInterface/Views/TimelineDataGrid.js:

(WebInspector.TimelineDataGrid.prototype._popoverCallStackTreeElementSelected):

  • UserInterface/Views/TimelineSidebarPanel.js:

(WebInspector.TimelineSidebarPanel):
(WebInspector.TimelineSidebarPanel.prototype.shown):
(WebInspector.TimelineSidebarPanel.showTimelineViewForTimeline):

Location:
trunk/Source/WebInspectorUI
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r183330 r183331  
     12015-04-23  Timothy Hatcher  <timothy@apple.com>
     2
     3        Web Inspector: Make showing a content view work in the tab world
     4        https://bugs.webkit.org/show_bug.cgi?id=144110
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        * UserInterface/Base/Main.js:
     9        (WebInspector.loaded):
     10        (WebInspector.hideSplitConsole):
     11        (WebInspector.showSourceCodeLocation):
     12        (WebInspector.showOriginalUnformattedSourceCodeLocation):
     13        (WebInspector.showOriginalOrFormattedSourceCodeLocation):
     14        (WebInspector.showOriginalOrFormattedSourceCodeTextRange):
     15        (WebInspector.showResourceRequest):
     16        (WebInspector.debuggerToggleBreakpoints):
     17        (WebInspector.debuggerPauseResumeToggle):
     18        (WebInspector.debuggerStepOver):
     19        (WebInspector.debuggerStepInto):
     20        (WebInspector.debuggerStepOut):
     21        (WebInspector._focusChanged):
     22        (WebInspector._mouseWasClicked):
     23        (WebInspector._dragOver):
     24        (WebInspector._captureDidStart):
     25        (WebInspector._debuggerDidPause):
     26        (WebInspector._debuggerDidResume):
     27        (WebInspector._frameWasAdded):
     28        (WebInspector._undock):
     29        (WebInspector._updateDockNavigationItems):
     30        * UserInterface/Models/Breakpoint.js:
     31        (WebInspector.Breakpoint.prototype.appendContextMenuItems.revealOriginalSourceCodeLocation):
     32        (WebInspector.Breakpoint.prototype.appendContextMenuItems):
     33        * UserInterface/Protocol/InspectorFrontendAPI.js:
     34        (InspectorFrontendAPI.showMainResourceForFrame):
     35        * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
     36        (WebInspector.CSSStyleDeclarationTextEditor.prototype.tokenTrackingControllerHighlightedRangeWasClicked):
     37        * UserInterface/Views/ComputedStyleDetailsPanel.js:
     38        (WebInspector.ComputedStyleDetailsPanel.prototype._goToRegionFlowArrowWasClicked):
     39        (WebInspector.ComputedStyleDetailsPanel.prototype._goToContentFlowArrowWasClicked):
     40        (WebInspector.ComputedStyleDetailsPanel):
     41        * UserInterface/Views/ContentBrowser.js:
     42        (WebInspector.ContentBrowser.prototype.updateHierarchicalPathForCurrentContentView):
     43        * UserInterface/Views/ContentView.js:
     44        (WebInspector.ContentView):
     45        * UserInterface/Views/DOMTreeContentView.js:
     46        (WebInspector.DOMTreeContentView.prototype.restoreFromCookie):
     47        * UserInterface/Views/DOMTreeDataGridNode.js:
     48        (WebInspector.DOMTreeDataGridNode.prototype._goToArrowWasClicked):
     49        * UserInterface/Views/DebuggerSidebarPanel.js:
     50        (WebInspector.DebuggerSidebarPanel.prototype.showDefaultContentView):
     51        (WebInspector.DebuggerSidebarPanel.prototype._addTreeElementForSourceCodeToContentTreeOutline):
     52        (WebInspector.DebuggerSidebarPanel.prototype._treeElementSelected):
     53        (WebInspector.DebuggerSidebarPanel.prototype._addIssue):
     54        (WebInspector.DebuggerSidebarPanel.prototype._handleIssueAdded):
     55        * UserInterface/Views/LayerTreeDataGridNode.js:
     56        (WebInspector.LayerTreeDataGridNode.prototype._goToArrowWasClicked):
     57        * UserInterface/Views/LayoutTimelineView.js:
     58        (WebInspector.LayoutTimelineView.prototype._treeElementSelected):
     59        * UserInterface/Views/NavigationSidebarPanel.js:
     60        (WebInspector.NavigationSidebarPanel.prototype.get contentBrowser):
     61        (WebInspector.NavigationSidebarPanel.prototype.set contentBrowser):
     62        (WebInspector.NavigationSidebarPanel.prototype._updateFilter):
     63        * UserInterface/Views/NetworkTimelineView.js:
     64        (WebInspector.NetworkTimelineView.prototype._treeElementSelected):
     65        * UserInterface/Views/ObjectTreeBaseTreeElement.js:
     66        (WebInspector.ObjectTreeBaseTreeElement.prototype._appendMenusItemsForObject):
     67        (WebInspector.ObjectTreeBaseTreeElement):
     68        * UserInterface/Views/OverviewTimelineView.js:
     69        (WebInspector.OverviewTimelineView.prototype._treeElementSelected):
     70        * UserInterface/Views/ResourceDetailsSidebarPanel.js:
     71        (WebInspector.ResourceDetailsSidebarPanel.prototype._goToRequestDataClicked):
     72        * UserInterface/Views/ResourceSidebarPanel.js:
     73        (WebInspector.ResourceSidebarPanel):
     74        (WebInspector.ResourceSidebarPanel.prototype.showDefaultContentView):
     75        (WebInspector.ResourceSidebarPanel.prototype._mainFrameDidChange):
     76        (WebInspector.ResourceSidebarPanel.prototype._mainFrameMainResourceDidChange.delayedWork):
     77        (WebInspector.ResourceSidebarPanel.prototype._mainFrameMainResourceDidChange):
     78        (WebInspector.ResourceSidebarPanel.prototype._treeElementSelected):
     79        (WebInspector.ResourceSidebarPanel.prototype._storageCleared):
     80        * UserInterface/Views/ResourceTimelineDataGridNode.js:
     81        (WebInspector.ResourceTimelineDataGridNode.prototype._goToResource):
     82        * UserInterface/Views/ScriptTimelineView.js:
     83        (WebInspector.ScriptTimelineView.prototype._treeElementSelected):
     84        * UserInterface/Views/SourceCodeTextEditor.js:
     85        (WebInspector.SourceCodeTextEditor.prototype.tokenTrackingControllerHighlightedRangeWasClicked):
     86        * UserInterface/Views/TimelineDataGrid.js:
     87        (WebInspector.TimelineDataGrid.prototype._popoverCallStackTreeElementSelected):
     88        * UserInterface/Views/TimelineSidebarPanel.js:
     89        (WebInspector.TimelineSidebarPanel):
     90        (WebInspector.TimelineSidebarPanel.prototype.shown):
     91        (WebInspector.TimelineSidebarPanel.showTimelineViewForTimeline):
     92
    1932015-04-22  Timothy Hatcher  <timothy@apple.com>
    294
  • trunk/Source/WebInspectorUI/UserInterface/Base/Main.js

    r183330 r183331  
    129129    this.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.DOMNodeWasInspected, this._domNodeWasInspected, this);
    130130    this.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.MainFrameDidChange, this._mainFrameDidChange, this);
     131    this.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.FrameWasAdded, this._frameWasAdded, this);
    131132
    132133    WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
     
    548549    if (resource) {
    549550        var position = new WebInspector.SourceCodePosition(lineNumber, 0);
    550         this.resourceSidebarPanel.showSourceCode(resource, position);
     551        this.showSourceCode(resource, position);
    551552        return;
    552553    }
     
    733734};
    734735
     736WebInspector.tabContentViewClassForRepresentedObject = function(representedObject)
     737{
     738    if (representedObject instanceof WebInspector.DOMTree)
     739        return WebInspector.ElementsTabContentView;
     740
     741    if (representedObject instanceof WebInspector.TimelineRecording)
     742        return WebInspector.TimelineTabContentView;
     743
     744    // We only support one console tab right now. So this isn't an instanceof check.
     745    if (representedObject === this._consoleRepresentedObject)
     746        return WebInspector.ConsoleTabContentView;
     747
     748    if (WebInspector.debuggerManager.paused) {
     749        if (representedObject instanceof WebInspector.Script)
     750            return WebInspector.DebuggerTabContentView;
     751
     752        if (representedObject instanceof WebInspector.Resource && (representedObject.type === WebInspector.Resource.Type.Document || representedObject.type === WebInspector.Resource.Type.Script))
     753            return WebInspector.DebuggerTabContentView;
     754    }
     755
     756    if (representedObject instanceof WebInspector.Frame || representedObject instanceof WebInspector.Resource || representedObject instanceof WebInspector.Script)
     757        return WebInspector.ResourcesTabContentView;
     758
     759    // FIXME: Move Content Flows to the Elements tab?
     760    if (representedObject instanceof WebInspector.ContentFlow)
     761        return WebInspector.ResourcesTabContentView;
     762
     763    // FIXME: Move these to a Storage tab.
     764    if (representedObject instanceof WebInspector.DOMStorageObject || representedObject instanceof WebInspector.CookieStorageObject ||
     765        representedObject instanceof WebInspector.DatabaseTableObject || representedObject instanceof WebInspector.DatabaseObject ||
     766        representedObject instanceof WebInspector.ApplicationCacheFrame || representedObject instanceof WebInspector.IndexedDatabaseObjectStore ||
     767        representedObject instanceof WebInspector.IndexedDatabaseObjectStoreIndex)
     768        return WebInspector.ResourcesTabContentView;
     769
     770    return null;
     771};
     772
     773WebInspector.tabContentViewForRepresentedObject = function(representedObject)
     774{
     775    var tabContentView = this.tabBrowser.bestTabContentViewForRepresentedObject(representedObject);
     776    if (tabContentView)
     777        return tabContentView;
     778
     779    var tabContentViewClass = this.tabContentViewClassForRepresentedObject(representedObject);
     780    if (!tabContentViewClass) {
     781        console.error("Unknown representedObject, couldn't create TabContentView.", representedObject);
     782        return null;
     783    }
     784
     785    tabContentView = new tabContentViewClass;
     786
     787    this.tabBrowser.addTabForContentView(tabContentView);
     788
     789    return tabContentView;
     790};
     791
     792WebInspector.showRepresentedObject = function(representedObject, cookie, forceShowTab)
     793{
     794    var tabContentView = this.tabContentViewForRepresentedObject(representedObject);
     795    console.assert(tabContentView);
     796    if (!tabContentView)
     797        return;
     798
     799    if (window.event || forceShowTab)
     800        this.tabBrowser.showTabForContentView(tabContentView);
     801
     802    tabContentView.showRepresentedObject(representedObject, cookie);
     803};
     804
     805WebInspector.showMainFrameDOMTree = function(nodeToSelect, forceShowTab)
     806{
     807    console.assert(WebInspector.frameResourceManager.mainFrame);
     808    if (!WebInspector.frameResourceManager.mainFrame)
     809        return;
     810    this.showRepresentedObject(WebInspector.frameResourceManager.mainFrame.domTree, {nodeToSelect}, forceShowTab);
     811};
     812
     813WebInspector.showContentFlowDOMTree = function(contentFlow, nodeToSelect, forceShowTab)
     814{
     815    this.showRepresentedObject(contentFlow, {nodeToSelect}, forceShowTab);
     816};
     817
     818WebInspector.showSourceCodeForFrame = function(frameIdentifier, forceShowTab)
     819{
     820    var frame = WebInspector.frameResourceManager.frameForIdentifier(frameIdentifier);
     821    if (!frame) {
     822        this._frameIdentifierToShowSourceCodeWhenAvailable = frameIdentifier;
     823        return;
     824    }
     825
     826    this._frameIdentifierToShowSourceCodeWhenAvailable = undefined;
     827
     828    this.showRepresentedObject(frame, null, forceShowTab);
     829};
     830
     831WebInspector.showSourceCode = function(sourceCode, positionToReveal, textRangeToSelect, forceUnformatted, forceShowTab)
     832{
     833    console.assert(!positionToReveal || positionToReveal instanceof WebInspector.SourceCodePosition, positionToReveal);
     834    var representedObject = sourceCode;
     835
     836    if (representedObject instanceof WebInspector.Script) {
     837        // A script represented by a resource should always show the resource.
     838        representedObject = representedObject.resource || representedObject;
     839    }
     840
     841    var cookie = positionToReveal ? {lineNumber: positionToReveal.lineNumber, columnNumber: positionToReveal.columnNumber} : {};
     842    this.showRepresentedObject(representedObject, cookie, forceShowTab);
     843};
     844
     845WebInspector.showSourceCodeLocation = function(sourceCodeLocation, forceShowTab)
     846{
     847    this.showSourceCode(sourceCodeLocation.displaySourceCode, sourceCodeLocation.displayPosition(), null, false, forceShowTab);
     848};
     849
     850WebInspector.showOriginalUnformattedSourceCodeLocation = function(sourceCodeLocation, forceShowTab)
     851{
     852    this.showSourceCode(sourceCodeLocation.sourceCode, sourceCodeLocation.position(), null, true);
     853};
     854
     855WebInspector.showOriginalOrFormattedSourceCodeLocation = function(sourceCodeLocation, forceShowTab)
     856{
     857    this.showSourceCode(sourceCodeLocation.sourceCode, sourceCodeLocation.formattedPosition(), null, false, forceShowTab);
     858};
     859
     860WebInspector.showOriginalOrFormattedSourceCodeTextRange = function(sourceCodeTextRange, forceShowTab)
     861{
     862    var textRangeToSelect = sourceCodeTextRange.formattedTextRange;
     863    this.showSourceCode(sourceCodeTextRange.sourceCode, textRangeToSelect.startPosition(), textRangeToSelect, false, forceShowTab);
     864};
     865
     866WebInspector.showResourceRequest = function(resource, forceShowTab)
     867{
     868    this.showRepresentedObject(resource, {[WebInspector.ResourceClusterContentView.ContentViewIdentifierCookieKey]: WebInspector.ResourceClusterContentView.RequestIdentifier}, forceShowTab);
     869};
     870
    735871WebInspector.debuggerToggleBreakpoints = function(event)
    736872{
     
    832968{
    833969    this.dashboardContainer.closeDashboardViewForRepresentedObject(this.dashboardManager.dashboards.debugger);
     970};
     971
     972WebInspector._frameWasAdded = function(event)
     973{
     974    if (!this._frameIdentifierToShowSourceCodeWhenAvailable)
     975        return;
     976
     977    var frame = event.data.frame;
     978    if (frame.id !== this._frameIdentifierToShowSourceCodeWhenAvailable)
     979        return;
     980
     981    this.showSourceCodeForFrame(frame.id);
    834982};
    835983
     
    16971845
    16981846        if (event.metaKey)
    1699             this.resourceSidebarPanel.showOriginalUnformattedSourceCodeLocation(sourceCodeLocation);
     1847            this.showOriginalUnformattedSourceCodeLocation(sourceCodeLocation);
    17001848        else
    1701             this.resourceSidebarPanel.showSourceCodeLocation(sourceCodeLocation);
     1849            this.showSourceCodeLocation(sourceCodeLocation);
    17021850    }
    17031851
  • trunk/Source/WebInspectorUI/UserInterface/Models/Breakpoint.js

    r181769 r183331  
    242242        function revealOriginalSourceCodeLocation()
    243243        {
    244             WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(this._sourceCodeLocation);
     244            WebInspector.showOriginalOrFormattedSourceCodeLocation(this._sourceCodeLocation);
    245245        }
    246246
  • trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorFrontendAPI.js

    r183268 r183331  
    9393    {
    9494        WebInspector.ignoreLastContentCookie = true;
    95         WebInspector.navigationSidebar.selectedSidebarPanel = WebInspector.resourceSidebarPanel;
    96         WebInspector.resourceSidebarPanel.showSourceCodeForFrame(frameIdentifier, true);
     95        WebInspector.showSourceCodeForFrame(frameIdentifier, true);
    9796    },
    9897
  • trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js

    r182576 r183331  
    994994        }
    995995
    996         WebInspector.resourceSidebarPanel.showSourceCodeLocation(sourceCodeLocation);
     996        WebInspector.showSourceCodeLocation(sourceCodeLocation);
    997997    }
    998998
  • trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsPanel.js

    r182055 r183331  
    205205    _goToRegionFlowArrowWasClicked()
    206206    {
    207         WebInspector.resourceSidebarPanel.showContentFlowDOMTree(this._regionFlow);
     207        WebInspector.showContentFlowDOMTree(this._regionFlow);
    208208    }
    209209
    210210    _goToContentFlowArrowWasClicked()
    211211    {
    212         WebInspector.resourceSidebarPanel.showContentFlowDOMTree(this._contentFlow, this.nodeStyles.node, true);
     212        WebInspector.showContentFlowDOMTree(this._contentFlow, this.nodeStyles.node, true);
    213213    }
    214214};
  • trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowser.js

    r183325 r183331  
    188188    },
    189189
     190    updateHierarchicalPathForCurrentContentView: function()
     191    {
     192        var currentContentView = this.currentContentView;
     193        this._updateHierarchicalPathNavigationItem(currentContentView ? currentContentView.representedObject : null);
     194    },
     195
    190196    canGoBack: function()
    191197    {
  • trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js

    r183326 r183331  
    3232
    3333        if (representedObject instanceof WebInspector.Frame)
    34             return new WebInspector.FrameContentView(representedObject, extraArguments);
     34            return new WebInspector.ResourceClusterContentView(representedObject.mainResource, extraArguments);
    3535
    3636        if (representedObject instanceof WebInspector.Resource)
  • trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js

    r183326 r183331  
    141141    },
    142142
     143    restoreFromCookie: function(cookie)
     144    {
     145        if (!cookie || !cookie.nodeToSelect)
     146            return;
     147
     148        this.selectAndRevealDOMNode(cookie.nodeToSelect);
     149
     150        // Because nodeToSelect is ephemeral, we don't want to keep
     151        // it around in the back-forward history entries.
     152        cookie.nodeToSelect = undefined;
     153    },
     154
    143155    selectAndRevealDOMNode: function(domNode, preventFocusChange)
    144156    {
  • trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeDataGridNode.js

    r173492 r183331  
    8484    _goToArrowWasClicked: function()
    8585    {
    86         WebInspector.resourceSidebarPanel.showMainFrameDOMTree(this._domNode, true);
     86        WebInspector.showMainFrameDOMTree(this._domNode);
    8787    }
    8888};
  • trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js

    r183330 r183331  
    2626WebInspector.DebuggerSidebarPanel = class DebuggerSidebarPanel extends WebInspector.NavigationSidebarPanel
    2727{
    28     constructor()
     28    constructor(contentBrowser)
    2929    {
    3030        super("debugger", WebInspector.UIString("Debugger"), true);
     31
     32        this.contentBrowser = contentBrowser;
    3133
    3234        WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceChanged, this);
     
    180182    showDefaultContentView()
    181183    {
    182         WebInspector.resourceSidebarPanel.showDefaultContentView();
     184        var currentTreeElement = this._contentTreeOutline.children[0];
     185        while (currentTreeElement && !currentTreeElement.root) {
     186            if (currentTreeElement instanceof WebInspector.ResourceTreeElement || currentTreeElement instanceof WebInspector.ScriptTreeElement) {
     187                currentTreeElement.revealAndSelect();
     188                return;
     189            }
     190
     191            currentTreeElement = currentTreeElement.traverseNextTreeElement(false, null, true);
     192        }
    183193    }
    184194
     
    307317        }
    308318
     319        if (!treeElement) {
     320            console.error("Unknown sourceCode instance", sourceCode);
     321            return;
     322        }
     323
    309324        if (!treeElement.parent) {
    310325            treeElement.hasChildren = false;
     
    579594            deselectCallStackContentTreeElements.call(this);
    580595            deselectPauseReasonContentTreeElements.call(this);
    581             WebInspector.resourceSidebarPanel.showSourceCode(treeElement.representedObject);
     596            WebInspector.showSourceCode(treeElement.representedObject);
    582597            return;
    583598        }
     
    590605            var callFrame = treeElement.callFrame;
    591606            WebInspector.debuggerManager.activeCallFrame = callFrame;
    592             WebInspector.resourceSidebarPanel.showSourceCodeLocation(callFrame.sourceCodeLocation);
     607            WebInspector.showSourceCodeLocation(callFrame.sourceCodeLocation);
    593608            return;
    594609        }
     
    597612            deselectCallStackContentTreeElements.call(this);
    598613            deselectPauseReasonContentTreeElements.call(this);
    599             WebInspector.resourceSidebarPanel.showSourceCodeLocation(treeElement.issueMessage.sourceCodeLocation);
     614            WebInspector.showSourceCodeLocation(treeElement.issueMessage.sourceCodeLocation);
    600615            return;
    601616        }
     
    614629        var breakpoint = treeElement.breakpoint;
    615630        if (treeElement.treeOutline === this._pauseReasonTreeOutline) {
    616             WebInspector.resourceSidebarPanel.showSourceCodeLocation(breakpoint.sourceCodeLocation);
     631            WebInspector.showSourceCodeLocation(breakpoint.sourceCodeLocation);
    617632            return;
    618633        }
     
    625640            return;
    626641
    627         WebInspector.resourceSidebarPanel.showSourceCodeLocation(breakpoint.sourceCodeLocation);
     642        WebInspector.showSourceCodeLocation(breakpoint.sourceCodeLocation);
    628643    }
    629644
     
    762777    {
    763778        var parentTreeElement = this._addTreeElementForSourceCodeToContentTreeOutline(issueMessage.sourceCodeLocation.sourceCode);
     779        if (!parentTreeElement)
     780            return null;
     781
    764782        var issueTreeElement = new WebInspector.IssueTreeElement(issueMessage);
    765783
     
    776794
    777795        // We only want to show issues originating from JavaScript source code.
    778         if (!issue.lineNumber || (issue.source !== "javascript" && issue.source !== "console-api"))
     796        if (!issue.sourceCodeLocation || !issue.sourceCodeLocation.sourceCode || (issue.source !== "javascript" && issue.source !== "console-api"))
    779797            return;
    780798
  • trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeDataGridNode.js

    r173492 r183331  
    163163    {
    164164        var domNode = WebInspector.domTreeManager.nodeForId(this._layer.nodeId);
    165         WebInspector.resourceSidebarPanel.showMainFrameDOMTree(domNode, true);
     165        WebInspector.showMainFrameDOMTree(domNode);
    166166    }
    167167};
  • trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js

    r183327 r183331  
    7777    // Public
    7878
     79    get contentBrowser()
     80    {
     81        return this._contentBrowser;
     82    }
     83
     84    set contentBrowser(contentBrowser)
     85    {
     86        this._contentBrowser = contentBrowser || null;
     87    }
     88
    7989    get contentTreeOutlineElement()
    8090    {
     
    478488
    479489        // Filter may have hidden the selected resource in the timeline view, which should now notify its listeners.
     490        // FIXME: This is a layering violation. This should at least be in TimelineSidebarPanel.
    480491        if (selectedTreeElement && selectedTreeElement.hidden !== selectionWasHidden) {
    481             var currentContentView = WebInspector.contentBrowser.currentContentView;
     492            var currentContentView = this.contentBrowser.currentContentView;
    482493            if (currentContentView instanceof WebInspector.TimelineRecordingContentView && typeof currentContentView.currentTimelineView.filterUpdated === "function")
    483494                currentContentView.currentTimelineView.filterUpdated();
  • trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js

    r183325 r183331  
    152152    {
    153153        if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) {
    154             WebInspector.resourceSidebarPanel.showSourceCode(treeElement.representedObject);
     154            WebInspector.showSourceCode(treeElement.representedObject);
    155155            return true;
    156156        }
  • trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeBaseTreeElement.js

    r182933 r183331  
    224224
    225225                        var sourceCodeLocation = sourceCode.createSourceCodeLocation(location.lineNumber, location.columnNumber || 0);
    226                         WebInspector.resourceSidebarPanel.showSourceCodeLocation(sourceCodeLocation);
     226                        WebInspector.showSourceCodeLocation(sourceCodeLocation);
    227227                    });
    228228                });
  • trunk/Source/WebInspectorUI/UserInterface/Views/OverviewTimelineView.js

    r183325 r183331  
    341341
    342342        if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) {
    343             WebInspector.resourceSidebarPanel.showSourceCode(treeElement.representedObject);
     343            WebInspector.showSourceCode(treeElement.representedObject);
    344344            this._updateTreeElementWithCloseButton(treeElement);
    345345            return;
     
    357357        }
    358358
    359         WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(treeElement.sourceCodeTimeline.sourceCodeLocation);
     359        WebInspector.showOriginalOrFormattedSourceCodeLocation(treeElement.sourceCodeTimeline.sourceCodeLocation);
    360360        this._updateTreeElementWithCloseButton(treeElement);
    361361    },
  • trunk/Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineView.js

    r183325 r183331  
    158158    {
    159159        if (treeElement instanceof WebInspector.ProfileNodeTreeElement && treeElement.profileNode.sourceCodeLocation) {
    160             WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(treeElement.profileNode.sourceCodeLocation);
     160            WebInspector.showOriginalOrFormattedSourceCodeLocation(treeElement.profileNode.sourceCodeLocation);
    161161            return true;
    162162        }
  • trunk/Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSidebarPanel.js

    r183327 r183331  
    399399    _goToRequestDataClicked()
    400400    {
    401         WebInspector.resourceSidebarPanel.showResourceRequest(this._resource);
     401        WebInspector.showResourceRequest(this._resource);
    402402    }
    403403
  • trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js

    r183327 r183331  
    2626WebInspector.ResourceSidebarPanel = class ResourceSidebarPanel extends WebInspector.NavigationSidebarPanel
    2727{
    28     constructor()
     28    constructor(contentBrowser)
    2929    {
    3030        super("resource", WebInspector.UIString("Resources"), true, true);
     31
     32        this.contentBrowser = contentBrowser;
    3133
    3234        var searchElement = document.createElement("div");
     
    8082
    8183        WebInspector.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.MainFrameDidChange, this._mainFrameDidChange, this);
    82         WebInspector.frameResourceManager.addEventListener(WebInspector.FrameResourceManager.Event.FrameWasAdded, this._frameWasAdded, this);
    83 
    84         WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.DOMNodeWasInspected, this._domNodeWasInspected, this);
    8584
    8685        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, this._scriptWasAdded, this);
     
    106105    {
    107106        if (WebInspector.frameResourceManager.mainFrame) {
    108             this.showMainFrame();
     107            this.contentBrowser.showContentViewForRepresentedObject(WebInspector.frameResourceManager.mainFrame);
    109108            return;
    110109        }
     
    120119    }
    121120
    122     showMainFrame(nodeToSelect, preventFocusChange)
    123     {
    124         WebInspector.contentBrowser.showContentViewForRepresentedObject(WebInspector.frameResourceManager.mainFrame);
    125     }
    126 
    127     showMainFrameDOMTree(nodeToSelect, preventFocusChange)
    128     {
    129         var contentView = WebInspector.contentBrowser.contentViewForRepresentedObject(WebInspector.frameResourceManager.mainFrame);
    130         contentView.showDOMTree(nodeToSelect, preventFocusChange);
    131         WebInspector.contentBrowser.showContentView(contentView);
    132     }
    133 
    134     showMainFrameSourceCode()
    135     {
    136         var contentView = WebInspector.contentBrowser.contentViewForRepresentedObject(WebInspector.frameResourceManager.mainFrame);
    137         contentView.showSourceCode();
    138         WebInspector.contentBrowser.showContentView(contentView);
    139     }
    140 
    141     showContentFlowDOMTree(contentFlow, nodeToSelect, preventFocusChange)
    142     {
    143         var contentView = WebInspector.contentBrowser.contentViewForRepresentedObject(contentFlow);
    144         if (nodeToSelect)
    145             contentView.selectAndRevealDOMNode(nodeToSelect, preventFocusChange);
    146         WebInspector.contentBrowser.showContentView(contentView);
    147     }
    148 
    149     showSourceCodeForFrame(frameIdentifier, revealAndSelectTreeElement)
    150     {
    151         delete this._frameIdentifierToShowSourceCodeWhenAvailable;
    152 
    153         // We can't show anything until we have the main frame in the sidebar.
    154         // Otherwise the path components in the navigation bar would be missing.
    155         var frame = WebInspector.frameResourceManager.frameForIdentifier(frameIdentifier);
    156         if (!frame || !this._mainFrameTreeElement) {
    157             this._frameIdentifierToShowSourceCodeWhenAvailable = frameIdentifier;
    158             return;
    159         }
    160 
    161         var contentView = WebInspector.contentBrowser.contentViewForRepresentedObject(frame);
    162         console.assert(contentView);
    163         if (!contentView)
    164             return;
    165 
    166         contentView.showSourceCode();
    167         WebInspector.contentBrowser.showContentView(contentView);
    168 
    169         if (revealAndSelectTreeElement)
    170             this.treeElementForRepresentedObject(frame).revealAndSelect(true, true, true, true);
    171     }
    172 
    173     showSourceCode(sourceCode, positionToReveal, textRangeToSelect, forceUnformatted)
    174     {
    175         console.assert(!positionToReveal || positionToReveal instanceof WebInspector.SourceCodePosition, positionToReveal);
    176         var representedObject = sourceCode;
    177 
    178         if (representedObject instanceof WebInspector.Script) {
    179             // A script represented by a resource should always show the resource.
    180             representedObject = representedObject.resource || representedObject;
    181         }
    182 
    183         // A main resource is always represented by its parent frame.
    184         if (representedObject instanceof WebInspector.Resource && representedObject.isMainResource())
    185             representedObject = representedObject.parentFrame;
    186 
    187         var cookie = positionToReveal ? {lineNumber: positionToReveal.lineNumber, columnNumber: positionToReveal.columnNumber} : {};
    188         WebInspector.contentBrowser.showContentViewForRepresentedObject(representedObject, cookie);
    189     }
    190 
    191     showSourceCodeLocation(sourceCodeLocation)
    192     {
    193         this.showSourceCode(sourceCodeLocation.displaySourceCode, sourceCodeLocation.displayPosition());
    194     }
    195 
    196     showOriginalUnformattedSourceCodeLocation(sourceCodeLocation)
    197     {
    198         this.showSourceCode(sourceCodeLocation.sourceCode, sourceCodeLocation.position(), undefined, true);
    199     }
    200 
    201     showOriginalOrFormattedSourceCodeLocation(sourceCodeLocation)
    202     {
    203         this.showSourceCode(sourceCodeLocation.sourceCode, sourceCodeLocation.formattedPosition());
    204     }
    205 
    206     showSourceCodeTextRange(sourceCodeTextRange)
    207     {
    208         var textRangeToSelect = sourceCodeTextRange.displayTextRange;
    209         this.showSourceCode(sourceCodeTextRange.displaySourceCode, textRangeToSelect.startPosition(), textRangeToSelect);
    210     }
    211 
    212     showOriginalOrFormattedSourceCodeTextRange(sourceCodeTextRange)
    213     {
    214         var textRangeToSelect = sourceCodeTextRange.formattedTextRange;
    215         this.showSourceCode(sourceCodeTextRange.sourceCode, textRangeToSelect.startPosition(), textRangeToSelect);
    216     }
    217 
    218     showResource(resource)
    219     {
    220         WebInspector.contentBrowser.showContentViewForRepresentedObject(resource.isMainResource() ? resource.parentFrame : resource);
    221     }
    222 
    223     showResourceRequest(resource)
    224     {
    225         var contentView = WebInspector.contentBrowser.contentViewForRepresentedObject(resource.isMainResource() ? resource.parentFrame : resource);
    226 
    227         if (contentView instanceof WebInspector.FrameContentView)
    228             var resourceContentView = contentView.showResource();
    229         else if (contentView instanceof WebInspector.ResourceClusterContentView)
    230             var resourceContentView = contentView;
    231 
    232         console.assert(resourceContentView instanceof WebInspector.ResourceClusterContentView);
    233         if (!(resourceContentView instanceof WebInspector.ResourceClusterContentView))
    234             return;
    235 
    236         resourceContentView.showRequest();
    237 
    238         WebInspector.contentBrowser.showContentView(contentView);
    239     }
    240 
    241121    treeElementForRepresentedObject(representedObject)
    242122    {
    243123        // A custom implementation is needed for this since the frames are populated lazily.
     124
     125        if (!this._mainFrameTreeElement && (representedObject instanceof WebInspector.Resource || representedObject instanceof WebInspector.Frame)) {
     126            // All resources are under the main frame, so we need to return early if we don't have the main frame yet.
     127            return null;
     128        }
    244129
    245130        // The Frame is used as the representedObject instead of the main resource in our tree.
     
    593478            this._resourcesContentTreeOutline.insertChild(this._mainFrameTreeElement, 0);
    594479
    595             // Select by default. Allow onselect if we aren't showing a content view.
    596             if (!this._resourcesContentTreeOutline.selectedTreeElement)
    597                 this._mainFrameTreeElement.revealAndSelect(true, false, !!WebInspector.contentBrowser.currentContentView);
    598 
    599             if (this._frameIdentifierToShowSourceCodeWhenAvailable)
    600                 this.showSourceCodeForFrame(this._frameIdentifierToShowSourceCodeWhenAvailable, true);
    601         }
     480            // Select a tree element by default. Allow onselect if we aren't showing a content view.
     481            if (!this._resourcesContentTreeOutline.selectedTreeElement) {
     482                var currentContentView = this.contentBrowser.currentContentView;
     483                var treeElement = currentContentView ? this.treeElementForRepresentedObject(currentContentView.representedObject) : null;
     484                if (!treeElement)
     485                    treeElement = this._mainFrameTreeElement;
     486                treeElement.revealAndSelect(true, false, !!currentContentView, true);
     487            }
     488        }
     489
     490        // The navigation path needs update when the main frame changes, since all resources are under the main frame.
     491        this.contentBrowser.updateHierarchicalPathForCurrentContentView();
    602492
    603493        // We only care about the first time the main frame changes.
     
    609499            return;
    610500
    611         delete this._waitingForInitialMainFrame;
     501        this._waitingForInitialMainFrame = false;
    612502
    613503        // Only if the last page searched is the same as the current page.
     
    622512    {
    623513        var wasShowingResourceSidebar = this.selected;
    624         var currentContentView = WebInspector.contentBrowser.currentContentView;
     514        var currentContentView = this.contentBrowser.currentContentView;
    625515        var wasShowingResourceContentView = currentContentView instanceof WebInspector.ResourceContentView
    626516            || currentContentView instanceof WebInspector.ResourceClusterContentView
     
    628518            || currentContentView instanceof WebInspector.ScriptContentView;
    629519
    630         // Close all resource and frame content views since the main frame has navigated and all resources are cleared.
    631         WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.ResourceClusterContentView);
    632         WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.FrameContentView);
    633         WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.ScriptContentView);
     520        this.contentBrowser.contentViewContainer.closeAllContentViews();
    634521
    635522        // Break out of search tree outline if there was an active search.
     
    640527            // Show the main frame since there is no content view showing or we were showing a resource before.
    641528            // Cookie restoration will attempt to re-select the resource we were showing.
    642             if (!WebInspector.contentBrowser.currentContentView || wasShowingResourceContentView) {
    643                 // If we were showing a resource inside of the ResourceSidebar, we should
    644                 // re-show the resource inside of the resource sidebar. It is possible that
    645                 // the sidebar panel could have switched to another view in the back-forward list.
    646                 if (wasShowingResourceSidebar)
    647                     WebInspector.navigationSidebar.selectedSidebarPanel = this;
    648 
     529            if (!this.contentBrowser.currentContentView || wasShowingResourceContentView) {
    649530                // NOTE: This selection, during provisional loading, won't be saved, so it is
    650531                // safe to do and not-clobber cookie restoration.
     
    656537        // before those listeners do their work might cause the content of the old page to show instead of the new page.
    657538        setTimeout(delayedWork.bind(this), 0);
    658     }
    659 
    660     _frameWasAdded(event)
    661     {
    662         if (!this._frameIdentifierToShowSourceCodeWhenAvailable)
    663             return;
    664 
    665         var frame = event.data.frame;
    666         if (frame.id !== this._frameIdentifierToShowSourceCodeWhenAvailable)
    667             return;
    668 
    669         this.showSourceCodeForFrame(frame.id, true);
    670539    }
    671540
     
    777646            treeElement instanceof WebInspector.ContentFlowTreeElement || treeElement instanceof WebInspector.IndexedDatabaseObjectStoreTreeElement ||
    778647            treeElement instanceof WebInspector.IndexedDatabaseObjectStoreIndexTreeElement) {
    779             WebInspector.contentBrowser.showContentViewForRepresentedObject(treeElement.representedObject);
     648            WebInspector.showRepresentedObject(treeElement.representedObject);
    780649            return;
    781650        }
     
    786655
    787656        if (treeElement.representedObject instanceof WebInspector.DOMSearchMatchObject)
    788             this.showMainFrameDOMTree(treeElement.representedObject.domNode, true);
     657            WebInspector.showMainFrameDOMTree(treeElement.representedObject.domNode);
    789658        else if (treeElement.representedObject instanceof WebInspector.SourceCodeSearchMatchObject)
    790             this.showOriginalOrFormattedSourceCodeTextRange(treeElement.representedObject.sourceCodeTextRange);
    791     }
    792 
    793     _domNodeWasInspected(event)
    794     {
    795         this.showMainFrameDOMTree(event.data.node);
     659            WebInspector.showOriginalOrFormattedSourceCodeTextRange(treeElement.representedObject.sourceCodeTextRange);
    796660    }
    797661
     
    929793    {
    930794        // Close all DOM and cookie storage content views since the main frame has navigated and all storages are cleared.
    931         WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.CookieStorageContentView);
    932         WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.DOMStorageContentView);
    933         WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.DatabaseTableContentView);
    934         WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.DatabaseContentView);
    935         WebInspector.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.ApplicationCacheFrameContentView);
     795        this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.CookieStorageContentView);
     796        this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.DOMStorageContentView);
     797        this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.DatabaseTableContentView);
     798        this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.DatabaseContentView);
     799        this.contentBrowser.contentViewContainer.closeAllContentViewsOfPrototype(WebInspector.ApplicationCacheFrameContentView);
    936800
    937801        if (this._localStorageRootTreeElement && this._localStorageRootTreeElement.parent)
  • trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTimelineDataGridNode.js

    r183134 r183331  
    170170    _goToResource: function(event)
    171171    {
    172         WebInspector.resourceSidebarPanel.showSourceCode(this._resource);
     172        WebInspector.showSourceCode(this._resource);
    173173    },
    174174
  • trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.js

    r183325 r183331  
    167167    {
    168168        if (treeElement instanceof WebInspector.ProfileNodeTreeElement && treeElement.profileNode.sourceCodeLocation) {
    169             WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(treeElement.profileNode.sourceCodeLocation);
     169            WebInspector.showOriginalOrFormattedSourceCodeLocation(treeElement.profileNode.sourceCodeLocation);
    170170            return true;
    171171        }
  • trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js

    r182990 r183331  
    13251325        var sourceCodeLocation = this._sourceCodeLocationForEditorPosition(this.tokenTrackingController.candidate.hoveredTokenRange.start);
    13261326        if (this.sourceCode instanceof WebInspector.SourceMapResource)
    1327             WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(sourceCodeLocation);
     1327            WebInspector.showOriginalOrFormattedSourceCodeLocation(sourceCodeLocation);
    13281328        else
    1329             WebInspector.resourceSidebarPanel.showSourceCodeLocation(sourceCodeLocation);
     1329            WebInspector.showSourceCodeLocation(sourceCodeLocation);
    13301330    }
    13311331
  • trunk/Source/WebInspectorUI/UserInterface/Views/TimelineDataGrid.js

    r182142 r183331  
    488488            return;
    489489
    490         WebInspector.resourceSidebarPanel.showSourceCodeLocation(callFrame.sourceCodeLocation);
     490        WebInspector.showSourceCodeLocation(callFrame.sourceCodeLocation);
    491491    }
    492492};
  • trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js

    r183327 r183331  
    2626WebInspector.TimelineSidebarPanel = class TimelineSidebarPanel extends WebInspector.NavigationSidebarPanel
    2727{
    28     constructor()
     28    constructor(contentBrowser)
    2929    {
    3030        super("timeline", WebInspector.UIString("Timelines"));
     31
     32        this.contentBrowser = contentBrowser;
    3133
    3234        this._timelineEventsTitleBarElement = document.createElement("div");
     
    121123        WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.RecordingLoaded, this._recordingLoaded, this);
    122124
    123         WebInspector.contentBrowser.addEventListener(WebInspector.ContentBrowser.Event.CurrentContentViewDidChange, this._contentBrowserCurrentContentViewDidChange, this);
     125        this.contentBrowser.addEventListener(WebInspector.ContentBrowser.Event.CurrentContentViewDidChange, this._contentBrowserCurrentContentViewDidChange, this);
    124126        WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingStarted, this._capturingStarted, this);
    125127        WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingStopped, this._capturingStopped, this);
     
    133135
    134136        if (this._displayedContentView)
    135             WebInspector.contentBrowser.showContentView(this._displayedContentView);
     137            this.contentBrowser.showContentView(this._displayedContentView);
    136138    }
    137139
     
    237239
    238240        this._displayedContentView.showOverviewTimelineView();
    239         WebInspector.contentBrowser.showContentView(this._displayedContentView);
     241        this.contentBrowser.showContentView(this._displayedContentView);
    240242    }
    241243
     
    285287        console.assert(cookie);
    286288
    287         cookie[WebInspector.TimelineSidebarPanel.ShowingTimelineRecordingContentViewCookieKey] = WebInspector.contentBrowser.currentContentView instanceof WebInspector.TimelineRecordingContentView;
     289        cookie[WebInspector.TimelineSidebarPanel.ShowingTimelineRecordingContentViewCookieKey] = this.contentBrowser.currentContentView instanceof WebInspector.TimelineRecordingContentView;
    288290
    289291        var selectedTreeElement = this._timelinesTreeOutline.selectedTreeElement;
     
    357359
    358360        this._displayedContentView.showTimelineViewForTimeline(timeline);
    359         WebInspector.contentBrowser.showContentView(this._displayedContentView);
     361        this.contentBrowser.showContentView(this._displayedContentView);
    360362    }
    361363
    362364    _contentBrowserCurrentContentViewDidChange(event)
    363365    {
    364         var didShowTimelineRecordingContentView = WebInspector.contentBrowser.currentContentView instanceof WebInspector.TimelineRecordingContentView;
     366        var didShowTimelineRecordingContentView = this.contentBrowser.currentContentView instanceof WebInspector.TimelineRecordingContentView;
    365367        this.element.classList.toggle(WebInspector.TimelineSidebarPanel.TimelineRecordingContentViewShowingStyleClass, didShowTimelineRecordingContentView);
    366368    }
     
    424426            this._timelineAdded(timeline);
    425427
    426         this._displayedContentView = WebInspector.contentBrowser.contentViewForRepresentedObject(this._displayedRecording, false, {timelineSidebarPanel: this});
     428        this._displayedContentView = this.contentBrowser.contentViewForRepresentedObject(this._displayedRecording, false, {timelineSidebarPanel: this});
    427429        if (this.selected)
    428             WebInspector.contentBrowser.showContentView(this._displayedContentView);
     430            this.contentBrowser.showContentView(this._displayedContentView);
    429431    }
    430432
  • trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js

    r183325 r183331  
    207207        }
    208208
    209         WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(sourceCodeLocation);
     209        WebInspector.showOriginalOrFormattedSourceCodeLocation(sourceCodeLocation);
    210210        return true;
    211211    },
Note: See TracChangeset for help on using the changeset viewer.