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

Unified Diff: Source/devtools/front_end/ui/ContextMenu.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/ui/ActionRegistry.js ('k') | Source/devtools/front_end/ui/KeyboardShortcut.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/ContextMenu.js
diff --git a/Source/devtools/front_end/ui/ContextMenu.js b/Source/devtools/front_end/ui/ContextMenu.js
index e98f9e76f9dd23f8d3f9f4ac223bf2ffe4a7961b..139189abf88473e7366b2663ded0bc7b00ca6b86 100644
--- a/Source/devtools/front_end/ui/ContextMenu.js
+++ b/Source/devtools/front_end/ui/ContextMenu.js
@@ -152,12 +152,14 @@ WebInspector.ContextSubMenuItem.prototype = {
},
/**
- * @param {string} label
* @param {string} actionId
+ * @param {string=} label
* @return {!WebInspector.ContextMenuItem}
*/
- appendAction: function(label, actionId)
+ appendAction: function(actionId, label)
{
+ if (!label)
+ label = WebInspector.actionRegistry.actionTitle(actionId);
var result = this.appendItem(label, WebInspector.actionRegistry.execute.bind(WebInspector.actionRegistry, actionId));
var shortcut = WebInspector.shortcutRegistry.shortcutTitleForAction(actionId);
if (shortcut)
@@ -435,7 +437,7 @@ WebInspector.ContextMenu.prototype = {
if (!group)
continue;
for (var extension of group)
- this.appendAction(extension.title(), extension.descriptor()["actionId"]);
+ this.appendAction(extension.descriptor()["actionId"]);
this.appendSeparator();
}
},
« no previous file with comments | « Source/devtools/front_end/ui/ActionRegistry.js ('k') | Source/devtools/front_end/ui/KeyboardShortcut.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698