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..7ffe2e4ef9bf08954ced1e3bf4721b5f1b120390 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 |
*/ |
@@ -910,6 +903,16 @@ WebInspector.ProfilesPanel.prototype = { |
contextMenu.appendItem(WebInspector.UIString.capitalize("Reveal in Summary ^view"), revealInView.bind(this, "Summary")); |
}, |
+ wasShown: function() |
+ { |
+ WebInspector.context.setFlavor(WebInspector.ProfilesPanel, this); |
+ }, |
+ |
+ willHide: function() |
+ { |
+ WebInspector.context.setFlavor(WebInspector.ProfilesPanel, null); |
+ }, |
+ |
__proto__: WebInspector.PanelWithSidebar.prototype |
} |
@@ -1269,3 +1272,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) |
+ { |
+ var panel = WebInspector.context.flavor(WebInspector.ProfilesPanel); |
+ console.assert(panel && panel instanceof WebInspector.ProfilesPanel); |
+ panel.toggleRecordButton(); |
+ } |
+} |