Chromium Code Reviews| 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 495ef5436a7ea3725d5a9ceb78a9826e9ffcb5a4..fac091ecce330f1852b2034ec4ae708709d4f51c 100644 |
| --- a/Source/devtools/front_end/timeline/TimelinePanel.js |
| +++ b/Source/devtools/front_end/timeline/TimelinePanel.js |
| @@ -303,8 +303,7 @@ WebInspector.TimelinePanel.prototype = { |
| { |
| this._panelToolbar = new WebInspector.Toolbar(this.element); |
| - this.toggleTimelineButton = new WebInspector.ToolbarButton("Record timeline", "record-toolbar-item"); |
| - this.toggleTimelineButton.addEventListener("click", this._toggleTimelineButtonClicked, this); |
| + this.toggleTimelineButton = WebInspector.ToolbarButton.createActionButton("timeline.toggle-recording"); |
| this._panelToolbar.appendToolbarItem(this.toggleTimelineButton); |
| this._updateToggleTimelineButton(false); |
| @@ -477,7 +476,6 @@ WebInspector.TimelinePanel.prototype = { |
| _registerShortcuts: function() |
| { |
| - this.registerShortcuts(WebInspector.ShortcutsScreen.TimelinePanelShortcuts.StartStopRecording, this._toggleTimelineButtonClicked.bind(this)); |
| this.registerShortcuts(WebInspector.ShortcutsScreen.TimelinePanelShortcuts.SaveToFile, this._saveToFile.bind(this)); |
| this.registerShortcuts(WebInspector.ShortcutsScreen.TimelinePanelShortcuts.LoadFromFile, this._selectFileToLoad.bind(this)); |
| this.registerShortcuts(WebInspector.ShortcutsScreen.TimelinePanelShortcuts.JumpToPreviousFrame, this._jumpToFrame.bind(this, -1)); |
| @@ -1801,3 +1799,25 @@ WebInspector.LoadTimelineHandler.prototype = { |
| WebInspector.TimelinePanel.instance()._loadFromURL(value); |
| } |
| } |
| + |
| +/** |
| + * @constructor |
| + * @implements {WebInspector.ActionDelegate} |
| + */ |
| +WebInspector.TimelinePanel.RecordActionDelegate = function() |
| +{ |
| +} |
| + |
| +WebInspector.TimelinePanel.RecordActionDelegate.prototype = { |
| + /** |
| + * @override |
| + * @param {!WebInspector.Context} context |
| + * @param {string} actionId |
| + */ |
| + handleAction: function(context, actionId) |
| + { |
| + if (WebInspector.inspectorView.currentPanel().name !== "timeline") |
|
samli
2015/08/21 02:41:12
Not sure how to better handle this. Couldn't find
pfeldman
2015/08/21 18:21:09
For example, we could add timeline panel's instanc
samli
2015/08/28 01:24:28
Done and fixed test. PTAL.
|
| + return; |
| + WebInspector.TimelinePanel.instance()._toggleTimelineButtonClicked(); |
| + } |
| +} |