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

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
« no previous file with comments | « Source/devtools/front_end/main/Main.js ('k') | Source/devtools/front_end/profiler/module.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
+ }
+}
« no previous file with comments | « Source/devtools/front_end/main/Main.js ('k') | Source/devtools/front_end/profiler/module.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698