{
if (this._overviewControl === overviewControl)
return;
- if (this._overviewControl)
+
+ var windowTimes = null;
+
+ if (this._overviewControl) {
+ windowTimes = this._overviewControl.windowTimes(this._overviewGrid.windowLeft(), this._overviewGrid.windowRight());
this._overviewControl.detach();
+ }
this._overviewControl = overviewControl;
this._overviewControl.show(this._overviewGrid.element);
this._update();
+ if (windowTimes)
+ this.setWindowTimes(windowTimes.startTime, windowTimes.endTime);
},
_update: function()
this._overviewCalculator.setWindow(this._model.minimumRecordTime(), this._model.maximumRecordTime());
this._overviewCalculator.setDisplayWindow(0, this._overviewGrid.clientWidth());
-
+ this._updateWindow();
if (this._overviewControl)
this._overviewControl.update();
this._overviewGrid.updateDividers(this._overviewCalculator);
},
/**
- * @return {number}
+ * @param {!WebInspector.Event} event
*/
- windowLeft: function()
+ _onWindowChanged: function(event)
{
- return this._overviewGrid.windowLeft();
+ if (this._ignoreWindowChangedEvent)
+ return;
+ var windowTimes = this._overviewControl.windowTimes(this._overviewGrid.windowLeft(), this._overviewGrid.windowRight());
+ this._windowStartTime = windowTimes.startTime;
+ this._windowEndTime = windowTimes.endTime;
+ this.dispatchEventToListeners(WebInspector.TimelineOverviewPane.Events.WindowChanged, windowTimes);
},
/**
- * @return {number}
+ * @param {number} startTime
+ * @param {number} endTime
*/
- windowRight: function()
+ setWindowTimes: function(startTime, endTime)
{
- return this._overviewGrid.windowRight();
+ this._windowStartTime = startTime;
+ this._windowEndTime = endTime;
+ this._updateWindow();
},
- _onWindowChanged: function()
- {
- if (this._ignoreWindowChangedEvent)
- return;
- this.dispatchEventToListeners(WebInspector.TimelineOverviewPane.Events.WindowChanged);
- },
-
- /**
- * @param {number} left
- * @param {number} right
- */
- setWindow: function(left, right)
+ _updateWindow: function()
{
+ var windowBoundaries = this._overviewControl.windowBoundaries(this._windowStartTime, this._windowEndTime);
this._ignoreWindowChangedEvent = true;
- this._overviewGrid.setWindow(left, right);
+ this._overviewGrid.setWindow(windowBoundaries.left, windowBoundaries.right);
this._overviewGrid.setResizeEnabled(this._model.records.length);
this._ignoreWindowChangedEvent = false;
},