Index: Source/devtools/front_end/profiler/ProfilesPanel.js |
diff --git a/Source/devtools/front_end/profiler/ProfilesPanel.js b/Source/devtools/front_end/profiler/ProfilesPanel.js |
index df0a5a33537dc93dd08ebc1caac1a983e3a4c635..f8e743193d94e0e74d46e6ac97cf4d43b4e86eaa 100644 |
--- a/Source/devtools/front_end/profiler/ProfilesPanel.js |
+++ b/Source/devtools/front_end/profiler/ProfilesPanel.js |
@@ -464,7 +464,7 @@ WebInspector.ProfilesPanel = function() |
var toolbar = new WebInspector.Toolbar(toolbarContainerLeft); |
this.recordButton = new WebInspector.ToolbarButton("", "record-toolbar-item"); |
- this.recordButton.addEventListener("click", this.toggleRecordButton, this); |
+ this.recordButton.setAction("profiler.toggle-recording"); |
toolbar.appendToolbarItem(this.recordButton); |
this.clearResultsButton = new WebInspector.ToolbarButton(WebInspector.UIString("Clear all profiles"), "clear-toolbar-item"); |
@@ -489,7 +489,6 @@ WebInspector.ProfilesPanel = function() |
this._createFileSelectorElement(); |
this.element.addEventListener("contextmenu", this._handleContextMenuEvent.bind(this), true); |
- this._registerShortcuts(); |
WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Events.SuspendStateChanged, this._onSuspendStateChanged, this); |
} |
@@ -526,11 +525,6 @@ WebInspector.ProfilesPanel.prototype = { |
return null; |
}, |
- _registerShortcuts: function() |
- { |
- this.registerShortcuts(WebInspector.ShortcutsScreen.ProfilesPanelShortcuts.StartStopRecording, this.toggleRecordButton.bind(this)); |
- }, |
- |
/** |
* @param {!File} file |
*/ |
@@ -1268,3 +1262,25 @@ WebInspector.ProfilesPanelFactory.prototype = { |
return WebInspector.ProfilesPanel._instance(); |
} |
} |
+ |
+/** |
+ * @constructor |
+ * @implements {WebInspector.ActionDelegate} |
+ */ |
+WebInspector.ProfilesPanel.RecordActionDelegate = function() |
+{ |
+} |
+ |
+WebInspector.ProfilesPanel.RecordActionDelegate.prototype = { |
+ /** |
+ * @override |
+ * @param {!WebInspector.Context} context |
+ * @param {string} actionId |
+ */ |
+ handleAction: function(context, actionId) |
+ { |
+ if (WebInspector.inspectorView.currentPanel().name !== "profiles") |
+ return; |
+ WebInspector.ProfilesPanel._instance().toggleRecordButton(); |
+ } |
+} |