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

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

Issue 2184683003: DevTools: Route timeline context menu save/load actions through module extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | third_party/WebKit/Source/devtools/front_end/timeline/module.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
index 7bbc5571343ff562a5d4673920510ec4b5499b14..11749bc8a5079b04b5f1e3871a118e885ce6276f 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
@@ -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";
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/timeline/module.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698