Commit 141c7f0c authored by pan.deng@intel.com's avatar pan.deng@intel.com

DevTools: Start/Stop overview recording for available mode

BUG=None

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

git-svn-id: svn://svn.chromium.org/blink/trunk@170330 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent ba1eec84
......@@ -231,6 +231,29 @@ WebInspector.TimelinePanel.prototype = {
return this._lazyFrameModel;
},
/**
* @return {!WebInspector.TimelinePanel.Mode}
*/
_availableModes: function()
{
if (this._modes)
return this._modes;
this._modes = {
Events: WebInspector.TimelinePanel.Mode.Events,
Frames: WebInspector.TimelinePanel.Mode.Frames,
Memory: WebInspector.TimelinePanel.Mode.Memory,
};
if (WebInspector.experimentsSettings.timelineFlameChart.isEnabled())
this._modes.FlameChart = WebInspector.TimelinePanel.Mode.FlameChart;
if (Capabilities.canProfilePower)
this._modes.Power = WebInspector.TimelinePanel.Mode.Power;
return this._modes;
},
/**
* @return {!WebInspector.TimelineView}
*/
......@@ -294,10 +317,7 @@ WebInspector.TimelinePanel.prototype = {
var topPaneSidebarTree = new TreeOutline(overviewTreeElement);
this._overviewItems = {};
for (var mode in WebInspector.TimelinePanel.Mode) {
if (mode === WebInspector.TimelinePanel.Mode.FlameChart && !WebInspector.experimentsSettings.timelineFlameChart.isEnabled() ||
mode === WebInspector.TimelinePanel.Mode.Power && !Capabilities.canProfilePower)
continue;
for (var mode in this._availableModes()) {
this._overviewItems[mode] = new WebInspector.SidebarTreeElement("timeline-overview-sidebar-" + mode.toLowerCase(), WebInspector.UIString(mode));
var item = this._overviewItems[mode];
item.onselect = this._onModeChanged.bind(this, mode);
......@@ -558,7 +578,7 @@ WebInspector.TimelinePanel.prototype = {
{
this._userInitiatedRecording = userInitiated;
this._model.startRecording();
for (var mode in WebInspector.TimelinePanel.Mode)
for (var mode in this._availableModes())
this._viewsForMode(mode).overviewView.timelineStarted();
if (userInitiated)
......@@ -569,7 +589,7 @@ WebInspector.TimelinePanel.prototype = {
{
this._userInitiatedRecording = false;
this._model.stopRecording();
for (var mode in WebInspector.TimelinePanel.Mode)
for (var mode in this._availableModes())
this._viewsForMode(mode).overviewView.timelineStopped();
},
......
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