Title: [183325] trunk/Source/WebInspectorUI
Revision
183325
Author
[email protected]
Date
2015-04-25 18:17:23 -0700 (Sat, 25 Apr 2015)

Log Message

Web Inspector: Support passing extra arguments to ContentViews during construction
https://bugs.webkit.org/show_bug.cgi?id=144055

This allows us to pass the TimelineSidebarPanel to Timeline views since in the future
there could be multiple timeline sidebars, one per tab. So the global instance will
be going away.

This also removes the exception catching in ContentViewContainer. It doesn't really
help us and it makes debugging an exception harder.

Reviewed by Joseph Pecoraro.

* UserInterface/Views/ContentBrowser.js:
(WebInspector.ContentBrowser.prototype.showContentViewForRepresentedObject):
(WebInspector.ContentBrowser.prototype.contentViewForRepresentedObject):
* UserInterface/Views/ContentView.js:
(WebInspector.ContentView):
* UserInterface/Views/ContentViewContainer.js:
(WebInspector.ContentViewContainer.prototype.contentViewForRepresentedObject):
(WebInspector.ContentViewContainer.prototype.showContentViewForRepresentedObject):
* UserInterface/Views/LayoutTimelineView.js:
(WebInspector.LayoutTimelineView.prototype._dataGridFiltersDidChange):
(WebInspector.LayoutTimelineView.prototype._treeElementSelected):
(WebInspector.LayoutTimelineView.prototype._closeStatusButtonClicked):
* UserInterface/Views/NetworkTimelineView.js:
(WebInspector.NetworkTimelineView.prototype._dataGridFiltersDidChange):
(WebInspector.NetworkTimelineView.prototype._treeElementSelected):
(WebInspector.NetworkTimelineView.prototype._closeStatusButtonClicked):
* UserInterface/Views/OverviewTimelineView.js:
(WebInspector.OverviewTimelineView.prototype._treeElementSelected):
(WebInspector.OverviewTimelineView.prototype._closeStatusButtonClicked):
* UserInterface/Views/RenderingFrameTimelineView.js:
(WebInspector.RenderingFrameTimelineView):
* UserInterface/Views/ScriptTimelineView.js:
(WebInspector.ScriptTimelineView):
(WebInspector.ScriptTimelineView.prototype._dataGridFiltersDidChange):
(WebInspector.ScriptTimelineView.prototype._treeElementSelected):
(WebInspector.ScriptTimelineView.prototype._closeStatusButtonClicked):
* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView):
(WebInspector.TimelineRecordingContentView.prototype._currentContentViewDidChange):
(WebInspector.TimelineRecordingContentView.prototype._contentViewSelectionPathComponentDidChange):
(WebInspector.TimelineRecordingContentView.prototype._updateTimes):
(WebInspector.TimelineRecordingContentView.prototype._timeRangeSelectionChanged):
* UserInterface/Views/TimelineSidebarPanel.js:
* UserInterface/Views/TimelineView.js:
(WebInspector.TimelineView):
(WebInspector.TimelineView.prototype.get timelineSidebarPanel):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (183324 => 183325)


--- trunk/Source/WebInspectorUI/ChangeLog	2015-04-26 01:16:50 UTC (rev 183324)
+++ trunk/Source/WebInspectorUI/ChangeLog	2015-04-26 01:17:23 UTC (rev 183325)
@@ -1,3 +1,54 @@
+2015-04-22  Timothy Hatcher  <[email protected]>
+
+        Web Inspector: Support passing extra arguments to ContentViews during construction
+        https://bugs.webkit.org/show_bug.cgi?id=144055
+
+        This allows us to pass the TimelineSidebarPanel to Timeline views since in the future
+        there could be multiple timeline sidebars, one per tab. So the global instance will
+        be going away.
+
+        This also removes the exception catching in ContentViewContainer. It doesn't really
+        help us and it makes debugging an exception harder.
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Views/ContentBrowser.js:
+        (WebInspector.ContentBrowser.prototype.showContentViewForRepresentedObject):
+        (WebInspector.ContentBrowser.prototype.contentViewForRepresentedObject):
+        * UserInterface/Views/ContentView.js:
+        (WebInspector.ContentView):
+        * UserInterface/Views/ContentViewContainer.js:
+        (WebInspector.ContentViewContainer.prototype.contentViewForRepresentedObject):
+        (WebInspector.ContentViewContainer.prototype.showContentViewForRepresentedObject):
+        * UserInterface/Views/LayoutTimelineView.js:
+        (WebInspector.LayoutTimelineView.prototype._dataGridFiltersDidChange):
+        (WebInspector.LayoutTimelineView.prototype._treeElementSelected):
+        (WebInspector.LayoutTimelineView.prototype._closeStatusButtonClicked):
+        * UserInterface/Views/NetworkTimelineView.js:
+        (WebInspector.NetworkTimelineView.prototype._dataGridFiltersDidChange):
+        (WebInspector.NetworkTimelineView.prototype._treeElementSelected):
+        (WebInspector.NetworkTimelineView.prototype._closeStatusButtonClicked):
+        * UserInterface/Views/OverviewTimelineView.js:
+        (WebInspector.OverviewTimelineView.prototype._treeElementSelected):
+        (WebInspector.OverviewTimelineView.prototype._closeStatusButtonClicked):
+        * UserInterface/Views/RenderingFrameTimelineView.js:
+        (WebInspector.RenderingFrameTimelineView):
+        * UserInterface/Views/ScriptTimelineView.js:
+        (WebInspector.ScriptTimelineView):
+        (WebInspector.ScriptTimelineView.prototype._dataGridFiltersDidChange):
+        (WebInspector.ScriptTimelineView.prototype._treeElementSelected):
+        (WebInspector.ScriptTimelineView.prototype._closeStatusButtonClicked):
+        * UserInterface/Views/TimelineRecordingContentView.js:
+        (WebInspector.TimelineRecordingContentView):
+        (WebInspector.TimelineRecordingContentView.prototype._currentContentViewDidChange):
+        (WebInspector.TimelineRecordingContentView.prototype._contentViewSelectionPathComponentDidChange):
+        (WebInspector.TimelineRecordingContentView.prototype._updateTimes):
+        (WebInspector.TimelineRecordingContentView.prototype._timeRangeSelectionChanged):
+        * UserInterface/Views/TimelineSidebarPanel.js:
+        * UserInterface/Views/TimelineView.js:
+        (WebInspector.TimelineView):
+        (WebInspector.TimelineView.prototype.get timelineSidebarPanel):
+
 2015-04-18  Timothy Hatcher  <[email protected]>
 
         Web Inspector: Disable global keyboard shortcuts for background tabs

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowser.js (183324 => 183325)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowser.js	2015-04-26 01:16:50 UTC (rev 183324)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentBrowser.js	2015-04-26 01:17:23 UTC (rev 183325)
@@ -171,9 +171,9 @@
         this._contentViewContainer.updateLayout();
     },
 
-    showContentViewForRepresentedObject: function(representedObject, cookie)
+    showContentViewForRepresentedObject: function(representedObject, cookie, extraArguments)
     {
-        var contentView = this.contentViewForRepresentedObject(representedObject);
+        var contentView = this.contentViewForRepresentedObject(representedObject, false, extraArguments);
         return this._contentViewContainer.showContentView(contentView, cookie);
     },
 
@@ -182,9 +182,9 @@
         return this._contentViewContainer.showContentView(contentView, cookie);
     },
 
-    contentViewForRepresentedObject: function(representedObject, onlyExisting)
+    contentViewForRepresentedObject: function(representedObject, onlyExisting, extraArguments)
     {
-        return this._contentViewContainer.contentViewForRepresentedObject(representedObject, onlyExisting);
+        return this._contentViewContainer.contentViewForRepresentedObject(representedObject, onlyExisting, extraArguments);
     },
 
     canGoBack: function()

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js (183324 => 183325)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js	2015-04-26 01:16:50 UTC (rev 183324)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js	2015-04-26 01:17:23 UTC (rev 183325)
@@ -23,7 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WebInspector.ContentView = function(representedObject)
+WebInspector.ContentView = function(representedObject, extraArguments)
 {
     if (this.constructor === WebInspector.ContentView) {
         // When instantiated directly return an instance of a type-based concrete subclass.
@@ -31,64 +31,64 @@
         console.assert(representedObject);
 
         if (representedObject instanceof WebInspector.Frame)
-            return new WebInspector.FrameContentView(representedObject);
+            return new WebInspector.FrameContentView(representedObject, extraArguments);
 
         if (representedObject instanceof WebInspector.Resource)
-            return new WebInspector.ResourceClusterContentView(representedObject);
+            return new WebInspector.ResourceClusterContentView(representedObject, extraArguments);
 
         if (representedObject instanceof WebInspector.Script)
-            return new WebInspector.ScriptContentView(representedObject);
+            return new WebInspector.ScriptContentView(representedObject, extraArguments);
 
         if (representedObject instanceof WebInspector.TimelineRecording)
-            return new WebInspector.TimelineRecordingContentView(representedObject);
+            return new WebInspector.TimelineRecordingContentView(representedObject, extraArguments);
 
         if (representedObject instanceof WebInspector.Timeline) {
             var timelineType = representedObject.type;
             if (timelineType === WebInspector.TimelineRecord.Type.Network)
-                return new WebInspector.NetworkTimelineView(representedObject);
+                return new WebInspector.NetworkTimelineView(representedObject, extraArguments);
 
             if (timelineType === WebInspector.TimelineRecord.Type.Layout)
-                return new WebInspector.LayoutTimelineView(representedObject);
+                return new WebInspector.LayoutTimelineView(representedObject, extraArguments);
 
             if (timelineType === WebInspector.TimelineRecord.Type.Script)
-                return new WebInspector.ScriptTimelineView(representedObject);
+                return new WebInspector.ScriptTimelineView(representedObject, extraArguments);
 
             if (timelineType === WebInspector.TimelineRecord.Type.RenderingFrame)
-                return new WebInspector.RenderingFrameTimelineView(representedObject);
+                return new WebInspector.RenderingFrameTimelineView(representedObject, extraArguments);
         }
 
         if (representedObject instanceof WebInspector.DOMStorageObject)
-            return new WebInspector.DOMStorageContentView(representedObject);
+            return new WebInspector.DOMStorageContentView(representedObject, extraArguments);
 
         if (representedObject instanceof WebInspector.CookieStorageObject)
-            return new WebInspector.CookieStorageContentView(representedObject);
+            return new WebInspector.CookieStorageContentView(representedObject, extraArguments);
 
         if (representedObject instanceof WebInspector.DatabaseTableObject)
-            return new WebInspector.DatabaseTableContentView(representedObject);
+            return new WebInspector.DatabaseTableContentView(representedObject, extraArguments);
 
         if (representedObject instanceof WebInspector.DatabaseObject)
-            return new WebInspector.DatabaseContentView(representedObject);
+            return new WebInspector.DatabaseContentView(representedObject, extraArguments);
 
         if (representedObject instanceof WebInspector.IndexedDatabaseObjectStore)
-            return new WebInspector.IndexedDatabaseObjectStoreContentView(representedObject);
+            return new WebInspector.IndexedDatabaseObjectStoreContentView(representedObject, extraArguments);
 
         if (representedObject instanceof WebInspector.IndexedDatabaseObjectStoreIndex)
-            return new WebInspector.IndexedDatabaseObjectStoreContentView(representedObject);
+            return new WebInspector.IndexedDatabaseObjectStoreContentView(representedObject, extraArguments);
 
         if (representedObject instanceof WebInspector.ApplicationCacheFrame)
-            return new WebInspector.ApplicationCacheFrameContentView(representedObject);
+            return new WebInspector.ApplicationCacheFrameContentView(representedObject, extraArguments);
 
         if (representedObject instanceof WebInspector.DOMTree)
-            return new WebInspector.FrameDOMTreeContentView(representedObject);
+            return new WebInspector.FrameDOMTreeContentView(representedObject, extraArguments);
 
         if (representedObject instanceof WebInspector.LogObject)
-            return new WebInspector.LogContentView(representedObject);
+            return new WebInspector.LogContentView(representedObject, extraArguments);
 
         if (representedObject instanceof WebInspector.ContentFlow)
-            return new WebInspector.ContentFlowDOMTreeContentView(representedObject);
+            return new WebInspector.ContentFlowDOMTreeContentView(representedObject, extraArguments);
 
         if (typeof representedObject === "string" || representedObject instanceof String)
-            return new WebInspector.TextContentView(representedObject);
+            return new WebInspector.TextContentView(representedObject, extraArguments);
 
         console.assert(!WebInspector.ContentView.isViewable(representedObject));
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js (183324 => 183325)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js	2015-04-26 01:16:50 UTC (rev 183324)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentViewContainer.js	2015-04-26 01:17:23 UTC (rev 183325)
@@ -82,7 +82,7 @@
             currentContentView.updateLayout();
     },
 
-    contentViewForRepresentedObject: function(representedObject, onlyExisting)
+    contentViewForRepresentedObject: function(representedObject, onlyExisting, extraArguments)
     {
         console.assert(representedObject);
         if (!representedObject)
@@ -107,13 +107,12 @@
         if (onlyExisting)
             return null;
 
-        try {
-            // No existing content view found, make a new one.
-            contentView = new WebInspector.ContentView(representedObject);
-        } catch (e) {
-            console.error(e);
+        // No existing content view found, make a new one.
+        contentView = new WebInspector.ContentView(representedObject, extraArguments);
+
+        console.assert(contentView, "Unknown representedObject", representedObject);
+        if (!contentView)
             return null;
-        }
 
         // Remember this content view for future calls.
         if (!representedObject.__contentViews)
@@ -123,9 +122,9 @@
         return contentView;
     },
 
-    showContentViewForRepresentedObject: function(representedObject)
+    showContentViewForRepresentedObject: function(representedObject, extraArguments)
     {
-        var contentView = this.contentViewForRepresentedObject(representedObject);
+        var contentView = this.contentViewForRepresentedObject(representedObject, false, extraArguments);
         if (!contentView)
             return null;
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.js (183324 => 183325)


--- trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.js	2015-04-26 01:16:50 UTC (rev 183324)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.js	2015-04-26 01:17:23 UTC (rev 183325)
@@ -23,9 +23,9 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WebInspector.LayoutTimelineView = function(timeline)
+WebInspector.LayoutTimelineView = function(timeline, extraArguments)
 {
-    WebInspector.TimelineView.call(this, timeline);
+    WebInspector.TimelineView.call(this, timeline, extraArguments);
 
     console.assert(timeline.type === WebInspector.TimelineRecord.Type.Layout);
 
@@ -209,7 +209,7 @@
 
     _dataGridFiltersDidChange: function(event)
     {
-        WebInspector.timelineSidebarPanel.updateFilter();
+        this.timelineSidebarPanel.updateFilter();
     },
 
     _dataGridNodeSelected: function(event)

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js (183324 => 183325)


--- trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js	2015-04-26 01:16:50 UTC (rev 183324)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js	2015-04-26 01:17:23 UTC (rev 183325)
@@ -23,9 +23,9 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WebInspector.NetworkTimelineView = function(timeline)
+WebInspector.NetworkTimelineView = function(timeline, extraArguments)
 {
-    WebInspector.TimelineView.call(this, timeline);
+    WebInspector.TimelineView.call(this, timeline, extraArguments);
 
     console.assert(timeline.type === WebInspector.TimelineRecord.Type.Network);
 
@@ -209,7 +209,7 @@
 
     _dataGridFiltersDidChange: function(event)
     {
-        WebInspector.timelineSidebarPanel.updateFilter();
+        this.timelineSidebarPanel.updateFilter();
     },
 
     _dataGridNodeSelected: function(event)
@@ -235,6 +235,6 @@
     _closeStatusButtonClicked: function(event)
     {
         this.navigationSidebarTreeOutline.selectedTreeElement.deselect();
-        WebInspector.timelineSidebarPanel.showTimelineViewForTimeline(this.representedObject);
+        this.timelineSidebarPanel.showTimelineViewForTimeline(this.representedObject);
     }
 };

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/OverviewTimelineView.js (183324 => 183325)


--- trunk/Source/WebInspectorUI/UserInterface/Views/OverviewTimelineView.js	2015-04-26 01:16:50 UTC (rev 183324)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/OverviewTimelineView.js	2015-04-26 01:17:23 UTC (rev 183325)
@@ -23,9 +23,9 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WebInspector.OverviewTimelineView = function(recording)
+WebInspector.OverviewTimelineView = function(recording, extraArguments)
 {
-    WebInspector.TimelineView.call(this, recording);
+    WebInspector.TimelineView.call(this, recording, extraArguments);
 
     this.navigationSidebarTreeOutline._onselect_ = this._treeElementSelected.bind(this);
     this.navigationSidebarTreeOutline._ondeselect_ = this._treeElementDeselected.bind(this);
@@ -38,7 +38,7 @@
     this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged, this._dataGridNodeSelected, this);
     this._dataGrid.element.classList.add("no-header");
 
-    this._treeOutlineDataGridSynchronizer = new WebInspector.TreeOutlineDataGridSynchronizer(this._contentTreeOutline, this._dataGrid);
+    this._treeOutlineDataGridSynchronizer = new WebInspector.TreeOutlineDataGridSynchronizer(this.navigationSidebarTreeOutline, this._dataGrid);
 
     this._timelineRuler = new WebInspector.TimelineRuler;
     this._timelineRuler.allowsClippedLabels = true;
@@ -333,7 +333,7 @@
 
     _treeElementSelected: function(treeElement, selectedByUser)
     {
-        if (!WebInspector.timelineSidebarPanel.canShowDifferentContentView())
+        if (!this.timelineSidebarPanel.canShowDifferentContentView())
             return;
 
         if (treeElement instanceof WebInspector.FolderTreeElement)
@@ -351,7 +351,7 @@
         }
 
         if (!treeElement.sourceCodeTimeline.sourceCodeLocation) {
-            WebInspector.timelineSidebarPanel.showTimelineOverview();
+            this.timelineSidebarPanel.showTimelineOverview();
             this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);
             return;
         }
@@ -378,6 +378,6 @@
     _closeStatusButtonClicked: function(event)
     {
         this.navigationSidebarTreeOutline.selectedTreeElement.deselect();
-        WebInspector.timelineSidebarPanel.showTimelineOverview();
+        this.timelineSidebarPanel.showTimelineOverview();
     }
 };

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineView.js (183324 => 183325)


--- trunk/Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineView.js	2015-04-26 01:16:50 UTC (rev 183324)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineView.js	2015-04-26 01:17:23 UTC (rev 183325)
@@ -23,9 +23,9 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WebInspector.RenderingFrameTimelineView = function(timeline)
+WebInspector.RenderingFrameTimelineView = function(timeline, extraArguments)
 {
-    WebInspector.TimelineView.call(this, timeline);
+    WebInspector.TimelineView.call(this, timeline, extraArguments);
 
     console.assert(WebInspector.TimelineRecord.Type.RenderingFrame);
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.js (183324 => 183325)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.js	2015-04-26 01:16:50 UTC (rev 183324)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.js	2015-04-26 01:17:23 UTC (rev 183325)
@@ -23,9 +23,9 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WebInspector.ScriptTimelineView = function(timeline)
+WebInspector.ScriptTimelineView = function(timeline, extraArguments)
 {
-    WebInspector.TimelineView.call(this, timeline);
+    WebInspector.TimelineView.call(this, timeline, extraArguments);
 
     console.assert(timeline.type === WebInspector.TimelineRecord.Type.Script);
 
@@ -254,7 +254,7 @@
 
     _dataGridFiltersDidChange: function(event)
     {
-        WebInspector.timelineSidebarPanel.updateFilter();
+        this.timelineSidebarPanel.updateFilter();
     },
 
     _dataGridNodeSelected: function(event)

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js (183324 => 183325)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js	2015-04-26 01:16:50 UTC (rev 183324)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js	2015-04-26 01:17:23 UTC (rev 183325)
@@ -24,11 +24,15 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WebInspector.TimelineRecordingContentView = function(recording)
+WebInspector.TimelineRecordingContentView = function(recording, extraArguments)
 {
+    console.assert(extraArguments);
+    console.assert(extraArguments.timelineSidebarPanel instanceof WebInspector.TimelineSidebarPanel);
+
     WebInspector.ContentView.call(this, recording);
 
     this._recording = recording;
+    this._timelineSidebarPanel = extraArguments.timelineSidebarPanel;
 
     this.element.classList.add(WebInspector.TimelineRecordingContentView.StyleClassName);
 
@@ -49,7 +53,7 @@
     this._clearTimelineNavigationItem = new WebInspector.ButtonNavigationItem("clear-timeline", WebInspector.UIString("Clear Timeline"), trashImage.src, trashImage.width, trashImage.height);
     this._clearTimelineNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._clearTimeline, this);
 
-    this._overviewTimelineView = new WebInspector.OverviewTimelineView(recording);
+    this._overviewTimelineView = new WebInspector.OverviewTimelineView(recording, {timelineSidebarPanel: this._timelineSidebarPanel});
     this._overviewTimelineView.secondsPerPixel = this._timelineOverview.secondsPerPixel;
 
     this._timelineViewMap = new Map;
@@ -315,8 +319,8 @@
     {
         var timelineView = this.currentTimelineView;
         if (timelineView) {
-            WebInspector.timelineSidebarPanel.contentTreeOutline = timelineView.navigationSidebarTreeOutline;
-            WebInspector.timelineSidebarPanel.contentTreeOutlineLabel = timelineView.navigationSidebarTreeOutlineLabel;
+            this._timelineSidebarPanel.contentTreeOutline = timelineView.navigationSidebarTreeOutline;
+            this._timelineSidebarPanel.contentTreeOutlineLabel = timelineView.navigationSidebarTreeOutlineLabel;
 
             timelineView.startTime = this._timelineOverview.selectionStartTime;
             timelineView.endTime = this._timelineOverview.selectionStartTime + this._timelineOverview.selectionDuration;
@@ -329,7 +333,7 @@
 
     _pathComponentSelected: function(event)
     {
-        WebInspector.timelineSidebarPanel.showTimelineViewForTimeline(event.data.pathComponent.representedObject);
+        this._timelineSidebarPanel.showTimelineViewForTimeline(event.data.pathComponent.representedObject);
     },
 
     _contentViewSelectionPathComponentDidChange: function(event)
@@ -395,7 +399,7 @@
         if (this.currentTimelineView)
             this.currentTimelineView.currentTime = currentTime;
 
-        WebInspector.timelineSidebarPanel.updateFilter();
+        this._timelineSidebarPanel.updateFilter();
 
         // Force a layout now since we are already in an animation frame and don't need to delay it until the next.
         this._timelineOverview.updateLayoutIfNeeded();
@@ -502,7 +506,7 @@
 
         console.assert(!this._timelineViewMap.has(timeline), timeline);
 
-        this._timelineViewMap.set(timeline, new WebInspector.ContentView(timeline));
+        this._timelineViewMap.set(timeline, new WebInspector.ContentView(timeline, {timelineSidebarPanel: this._timelineSidebarPanel}));
 
         var pathComponent = new WebInspector.HierarchicalPathComponent(timeline.displayName, timeline.iconClassName, timeline);
         pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._pathComponentSelected, this);
@@ -592,7 +596,7 @@
             var selectedTreeElement = this.currentTimelineView && this.currentTimelineView.navigationSidebarTreeOutline ? this.currentTimelineView.navigationSidebarTreeOutline.selectedTreeElement : null;
             var selectionWasHidden = selectedTreeElement && selectedTreeElement.hidden;
 
-            WebInspector.timelineSidebarPanel.updateFilter();
+            this._timelineSidebarPanel.updateFilter();
 
             if (selectedTreeElement && selectedTreeElement.hidden !== selectionWasHidden)
                 this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js (183324 => 183325)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js	2015-04-26 01:16:50 UTC (rev 183324)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js	2015-04-26 01:17:23 UTC (rev 183325)
@@ -423,7 +423,7 @@
         for (var timeline of recording.timelines.values())
             this._timelineAdded(timeline);
 
-        this._displayedContentView = WebInspector.contentBrowser.contentViewForRepresentedObject(this._displayedRecording);
+        this._displayedContentView = WebInspector.contentBrowser.contentViewForRepresentedObject(this._displayedRecording, false, {timelineSidebarPanel: this});
         if (this.selected)
             WebInspector.contentBrowser.showContentView(this._displayedContentView);
     }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js (183324 => 183325)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js	2015-04-26 01:16:50 UTC (rev 183324)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js	2015-04-26 01:17:23 UTC (rev 183325)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
  * Copyright (C) 2015 University of Washington.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -24,18 +24,23 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WebInspector.TimelineView = function(representedObject)
+WebInspector.TimelineView = function(representedObject, extraArguments)
 {
     // This class should not be instantiated directly. Create a concrete subclass instead.
     console.assert(this.constructor !== WebInspector.TimelineView && this instanceof WebInspector.TimelineView);
 
+    console.assert(extraArguments);
+    console.assert(extraArguments.timelineSidebarPanel instanceof WebInspector.TimelineSidebarPanel);
+
     WebInspector.ContentView.call(this, representedObject);
 
-    this._contentTreeOutline = WebInspector.timelineSidebarPanel.createContentTreeOutline();
+    this._timelineSidebarPanel = extraArguments.timelineSidebarPanel;
+
+    this._contentTreeOutline = this._timelineSidebarPanel.createContentTreeOutline();
     this._contentTreeOutline._onselect_ = this.treeElementSelected.bind(this);
     this._contentTreeOutline._ondeselect_ = this.treeElementDeselected.bind(this);
 
-    this.element.classList.add(WebInspector.TimelineView.StyleClassName);
+    this.element.classList.add("timeline-view");
 
     this._zeroTime = 0;
     this._startTime = 0;
@@ -43,8 +48,6 @@
     this._currentTime = 0;
 };
 
-WebInspector.TimelineView.StyleClassName = "timeline-view";
-
 WebInspector.TimelineView.prototype = {
     constructor: WebInspector.TimelineView,
     __proto__: WebInspector.ContentView.prototype,
@@ -62,6 +65,11 @@
         return null;
     },
 
+    get timelineSidebarPanel()
+    {
+        return this._timelineSidebarPanel;
+    },
+
     get selectionPathComponents()
     {
         if (!this._contentTreeOutline.selectedTreeElement || this._contentTreeOutline.selectedTreeElement.hidden)
@@ -194,7 +202,7 @@
 
         var sourceCodeLocation = treeElement.record.sourceCodeLocation;
         if (!sourceCodeLocation) {
-            WebInspector.timelineSidebarPanel.showTimelineViewForTimeline(this.representedObject);
+            this._timelineSidebarPanel.showTimelineViewForTimeline(this.representedObject);
             return true;
         }
 
@@ -219,7 +227,7 @@
     {
         // Implemented by sub-classes if needed.
 
-        if (!WebInspector.timelineSidebarPanel.canShowDifferentContentView())
+        if (!this._timelineSidebarPanel.canShowDifferentContentView())
             return;
 
         if (treeElement instanceof WebInspector.FolderTreeElement)
@@ -249,7 +257,7 @@
         if (this.navigationSidebarTreeOutline.selectedTreeElement)
             this.navigationSidebarTreeOutline.selectedTreeElement.deselect();
 
-        WebInspector.timelineSidebarPanel.showTimelineViewForTimeline(this.representedObject);
+        this._timelineSidebarPanel.showTimelineViewForTimeline(this.representedObject);
     },
 
     _updateTreeElementWithCloseButton: function(treeElement)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to