Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1180)

Unified Diff: Source/devtools/front_end/timeline/TimelinePanel.js

Issue 322403004: Timeline: disable start/stop button and properly indicate progress when stop is pending (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: removed stray line in TimelineModel Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/timeline/TimelinePanel.js
diff --git a/Source/devtools/front_end/timeline/TimelinePanel.js b/Source/devtools/front_end/timeline/TimelinePanel.js
index 370bd701dfd49ada3f0fca1c3915b88b297c4520..382223c5be16908ce8e2753e76c11527b75526df 100644
--- a/Source/devtools/front_end/timeline/TimelinePanel.js
+++ b/Source/devtools/front_end/timeline/TimelinePanel.js
@@ -670,8 +670,12 @@ WebInspector.TimelinePanel.prototype = {
_stopRecording: function()
{
+ this._stopPending = true;
+ this._updateToggleTimelineButton(false);
this._userInitiatedRecording = false;
this._model.stopRecording();
+ if (this._progressElement)
+ this._updateProgress(WebInspector.UIString("Retrieving events\u2026"));
for (var i = 0; i < this._overviewControls.length; ++i)
this._overviewControls[i].timelineStopped();
@@ -687,13 +691,20 @@ WebInspector.TimelinePanel.prototype = {
*/
_updateToggleTimelineButton: function(toggled)
{
- var enable = toggled || !this._model.target().profilingLock.isAcquired();
- this.toggleTimelineButton.setEnabled(enable);
this.toggleTimelineButton.toggled = toggled;
- if (enable)
- this.toggleTimelineButton.title = toggled ? WebInspector.UIString("Stop") : WebInspector.UIString("Record");
- else
+ if (toggled) {
+ this.toggleTimelineButton.title = WebInspector.UIString("Stop");
+ 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");
yurys 2014/06/16 07:18:07 Hm, why do we show this message only when toggled
+ this.toggleTimelineButton.setEnabled(false);
+ } else {
+ this.toggleTimelineButton.title = WebInspector.UIString("Record");
+ this.toggleTimelineButton.setEnabled(true);
+ }
},
/**
@@ -793,6 +804,7 @@ WebInspector.TimelinePanel.prototype = {
_onRecordingStopped: function()
{
+ this._stopPending = false;
this._updateToggleTimelineButton(false);
if (this._lazyFrameModel) {
if (this._tracingTimelineModel) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698