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

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

Issue 361203002: [DevTools] Start/stop of timeline recording should set UI controls disabled/enabled respectively. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 6b29e6e664288b6ce4487d5b3da71f082c3b4f90..f486293017ba022e70b5b604e65492020d2d1fb8 100644
--- a/Source/devtools/front_end/timeline/TimelinePanel.js
+++ b/Source/devtools/front_end/timeline/TimelinePanel.js
@@ -330,34 +330,39 @@ WebInspector.TimelinePanel.prototype = {
var topPaneSidebarElement = this._topPane.sidebarElement();
this._captureStacksSetting = WebInspector.settings.createSetting("timelineCaptureStacks", true);
+ this._captureStacksCheckbox = document.createElement("input");
aandrey 2014/07/03 08:00:49 I'd create an array this._uiControlsCheckboxes, pu
topPaneSidebarElement.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIString("Capture stacks"),
- this._captureStacksSetting, true, undefined,
+ this._captureStacksSetting, true, this._captureStacksCheckbox,
WebInspector.UIString("Capture JavaScript stack on every timeline event")));
this._captureMemorySetting = WebInspector.settings.createSetting("timelineCaptureMemory", false);
+ this._captureMemoryCheckbox = document.createElement("input");
topPaneSidebarElement.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIString("Capture memory"),
- this._captureMemorySetting, true, undefined,
+ this._captureMemorySetting, true, this._captureMemoryCheckbox,
WebInspector.UIString("Capture memory information on every timeline event")));
this._captureMemorySetting.addChangeListener(this._onModeChanged, this);
if (Capabilities.canProfilePower) {
this._capturePowerSetting = WebInspector.settings.createSetting("timelineCapturePower", false);
+ this._capturePowerCheckbox = document.createElement("input");
topPaneSidebarElement.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIString("Capture power"),
- this._capturePowerSetting, true, undefined,
+ this._capturePowerSetting, true, this._capturePowerCheckbox,
WebInspector.UIString("Capture power information")));
this._capturePowerSetting.addChangeListener(this._onModeChanged, this);
}
if (WebInspector.experimentsSettings.timelineTracingMode.isEnabled()) {
this._captureTracingSetting = WebInspector.settings.createSetting("timelineCaptureTracing", false);
+ this._captureTracingCheckbox = document.createElement("input");
topPaneSidebarElement.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIString("Capture tracing"),
- this._captureTracingSetting, true, undefined,
+ this._captureTracingSetting, true, this._captureTracingCheckbox,
WebInspector.UIString("Capture tracing information")));
this._captureTracingSetting.addChangeListener(this._onModeChanged, this);
} else if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled()) {
this._captureLayersAndPicturesSetting = WebInspector.settings.createSetting("timelineCaptureLayersAndPictures", false);
+ this._captureLayersAndPicturesCheckbox = document.createElement("input");
topPaneSidebarElement.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIString("Capture pictures"),
- this._captureLayersAndPicturesSetting, true, undefined,
+ this._captureLayersAndPicturesSetting, true, this._captureLayersAndPicturesCheckbox,
WebInspector.UIString("Capture graphics layer positions and painted pictures")));
}
},
@@ -665,6 +670,23 @@ WebInspector.TimelinePanel.prototype = {
},
/**
+ * @param {boolean} disabled
+ */
+ _disableUIControls: function(disabled) {
+ this._captureStacksCheckbox.disabled = disabled;
+ this._captureMemoryCheckbox.disabled = disabled;
+ if (Capabilities.canProfilePower)
+ this._capturePowerCheckbox.disabled = disabled;
+
+ if (WebInspector.experimentsSettings.timelineTracingMode.isEnabled()) {
+ this._captureTracingCheckbox.disabled = disabled;
+ } else if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled()) {
+ this._captureLayersAndPicturesCheckbox.disabled = disabled;
+ }
+ WebInspector.inspectorView.setCurrentPanelLocked(disabled);
+ },
+
+ /**
* @param {boolean} userInitiated
*/
_startRecording: function(userInitiated)
@@ -679,7 +701,7 @@ WebInspector.TimelinePanel.prototype = {
if (userInitiated)
WebInspector.userMetrics.TimelineStarted.record();
- WebInspector.inspectorView.setCurrentPanelLocked(true);
+ this._disableUIControls(true);
},
_stopRecording: function()
@@ -693,7 +715,7 @@ WebInspector.TimelinePanel.prototype = {
for (var i = 0; i < this._overviewControls.length; ++i)
this._overviewControls[i].timelineStopped();
- WebInspector.inspectorView.setCurrentPanelLocked(false);
+ this._disableUIControls(false);
},
_onProfilingStateChanged: function()
« 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