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

Unified Diff: Source/devtools/front_end/profiler/ProfilesPanel.js

Issue 1273363002: Devtools UI: Show multiple shortcuts, show more shortcuts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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
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();
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698