Commit e8ac1f5e authored by alph's avatar alph Committed by Commit bot

DevTools: Route timeline context menu save/load actions through module extensions.

Review-Url: https://codereview.chromium.org/2184683003
Cr-Commit-Position: refs/heads/master@{#408225}
parent a8274f0b
......@@ -445,9 +445,7 @@ WebInspector.TimelinePanel.prototype = {
_contextMenu: function(event)
{
var contextMenu = new WebInspector.ContextMenu(event);
var disabled = this._state !== WebInspector.TimelinePanel.State.Idle;
contextMenu.appendItem(WebInspector.UIString.capitalize("Save Timeline ^data\u2026"), this._saveToFile.bind(this), disabled);
contextMenu.appendItem(WebInspector.UIString.capitalize("Load Timeline ^data\u2026"), this._selectFileToLoad.bind(this), disabled);
contextMenu.appendItemsAtLocation("timelineMenu");
contextMenu.show();
},
......@@ -458,6 +456,8 @@ WebInspector.TimelinePanel.prototype = {
{
if (this._state !== WebInspector.TimelinePanel.State.Idle)
return true;
if (this._model.isEmpty())
return true;
var now = new Date();
var fileName = "TimelineRawData-" + now.toISO8601Compact() + ".json";
......
......@@ -20,6 +20,16 @@
"name": "loadTimelineFromURL",
"className": "WebInspector.LoadTimelineHandler"
},
{
"type": "context-menu-item",
"location": "timelineMenu/open",
"actionId": "timeline.load-from-file"
},
{
"type": "context-menu-item",
"location": "timelineMenu/open",
"actionId": "timeline.save-to-file"
},
{
"type": "@WebInspector.ActionDelegate",
"actionId": "timeline.toggle-recording",
......@@ -43,9 +53,11 @@
},
{
"type": "@WebInspector.ActionDelegate",
"category": "Timeline",
"actionId": "timeline.save-to-file",
"contextTypes": ["WebInspector.TimelinePanel"],
"className": "WebInspector.TimelinePanel.ActionDelegate",
"title": "Save Timeline data\u2026",
"bindings": [
{
"platform": "windows,linux",
......@@ -59,10 +71,12 @@
},
{
"type": "@WebInspector.ActionDelegate",
"category": "Timeline",
"actionId": "timeline.load-from-file",
"contextTypes": ["WebInspector.TimelinePanel"],
"order": "10",
"className": "WebInspector.TimelinePanel.ActionDelegate",
"title": "Load Timeline data\u2026",
"bindings": [
{
"platform": "windows,linux",
......
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