Commit a688aba7 authored by caseq@chromium.org's avatar caseq@chromium.org

Timeline: disable start/stop button and properly indicate progress when stop is pending

Now that we may fetch a lot of trace (or buffered timeline) events after
timeline is stopped, we need a better indication of that. The button remaining
red after it's pressed is very annoying. Let's turn it off and disable till
we get all the events, and if the progress pane is on, display the appropriate
message there.

BUG=361045

Review URL: https://codereview.chromium.org/322403004

git-svn-id: svn://svn.chromium.org/blink/trunk@176214 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent dd625b40
...@@ -670,8 +670,12 @@ WebInspector.TimelinePanel.prototype = { ...@@ -670,8 +670,12 @@ WebInspector.TimelinePanel.prototype = {
_stopRecording: function() _stopRecording: function()
{ {
this._stopPending = true;
this._updateToggleTimelineButton(false);
this._userInitiatedRecording = false; this._userInitiatedRecording = false;
this._model.stopRecording(); this._model.stopRecording();
if (this._progressElement)
this._updateProgress(WebInspector.UIString("Retrieving events\u2026"));
for (var i = 0; i < this._overviewControls.length; ++i) for (var i = 0; i < this._overviewControls.length; ++i)
this._overviewControls[i].timelineStopped(); this._overviewControls[i].timelineStopped();
...@@ -687,13 +691,20 @@ WebInspector.TimelinePanel.prototype = { ...@@ -687,13 +691,20 @@ WebInspector.TimelinePanel.prototype = {
*/ */
_updateToggleTimelineButton: function(toggled) _updateToggleTimelineButton: function(toggled)
{ {
var enable = toggled || !this._model.target().profilingLock.isAcquired();
this.toggleTimelineButton.setEnabled(enable);
this.toggleTimelineButton.toggled = toggled; this.toggleTimelineButton.toggled = toggled;
if (enable) if (toggled) {
this.toggleTimelineButton.title = toggled ? WebInspector.UIString("Stop") : WebInspector.UIString("Record"); this.toggleTimelineButton.title = WebInspector.UIString("Stop");
else this.toggleTimelineButton.setEnabled(true);
} else if (this._stopPending) {
this.toggleTimelineButton.title = WebInspector.UIString("Stop pending");
this.toggleTimelineButton.setEnabled(false);
} else if (this._model.target().profilingLock.isAcquired()) {
this.toggleTimelineButton.title = WebInspector.UIString("Another profiler is already active"); this.toggleTimelineButton.title = WebInspector.UIString("Another profiler is already active");
this.toggleTimelineButton.setEnabled(false);
} else {
this.toggleTimelineButton.title = WebInspector.UIString("Record");
this.toggleTimelineButton.setEnabled(true);
}
}, },
/** /**
...@@ -793,6 +804,7 @@ WebInspector.TimelinePanel.prototype = { ...@@ -793,6 +804,7 @@ WebInspector.TimelinePanel.prototype = {
_onRecordingStopped: function() _onRecordingStopped: function()
{ {
this._stopPending = false;
this._updateToggleTimelineButton(false); this._updateToggleTimelineButton(false);
if (this._lazyFrameModel) { if (this._lazyFrameModel) {
if (this._tracingTimelineModel) { if (this._tracingTimelineModel) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment