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 261e82322200f11e3514bc76091226f7c3af5aa4..64445fb8e38b18b6e6e9a391bd8c92bcd4a2aa38 100644 |
--- a/Source/devtools/front_end/profiler/ProfilesPanel.js |
+++ b/Source/devtools/front_end/profiler/ProfilesPanel.js |
@@ -464,8 +464,7 @@ WebInspector.ProfilesPanel = function() |
this.panelSidebarElement().insertBefore(toolbarContainerLeft, this.panelSidebarElement().firstChild); |
var toolbar = new WebInspector.Toolbar(toolbarContainerLeft); |
- this.recordButton = new WebInspector.ToolbarButton("", "record-toolbar-item"); |
- this.recordButton.addEventListener("click", this.toggleRecordButton, this); |
+ this.recordButton = WebInspector.ToolbarButton.createActionButton("profiler.toggle-recording"); |
toolbar.appendToolbarItem(this.recordButton); |
this.clearResultsButton = new WebInspector.ToolbarButton(WebInspector.UIString("Clear all profiles"), "clear-toolbar-item"); |
@@ -490,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); |
} |
@@ -527,11 +525,6 @@ WebInspector.ProfilesPanel.prototype = { |
return null; |
}, |
- _registerShortcuts: function() |
- { |
- this.registerShortcuts(WebInspector.ShortcutsScreen.ProfilesPanelShortcuts.StartStopRecording, this.toggleRecordButton.bind(this)); |
- }, |
- |
/** |
* @param {!File} file |
*/ |
@@ -1269,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(); |
+ } |
+} |