Index: Source/devtools/front_end/ui/Tooltip.js |
diff --git a/Source/devtools/front_end/ui/Tooltip.js b/Source/devtools/front_end/ui/Tooltip.js |
index 7cb6998eb028b5c0839b30c8b5541d2d72ed1e15..8e8fdb8e7265813240eb07c1c0e9cb7d718339c1 100644 |
--- a/Source/devtools/front_end/ui/Tooltip.js |
+++ b/Source/devtools/front_end/ui/Tooltip.js |
@@ -64,11 +64,11 @@ WebInspector.Tooltip.prototype = { |
else |
this._tooltipElement.appendChild(tooltip.content); |
- if (tooltip.actionId) { |
- var shortcuts = WebInspector.shortcutRegistry.shortcutDescriptorsForAction(tooltip.actionId); |
- if (shortcuts && shortcuts.length) { |
+ if (tooltip.shortcuts || tooltip.actionId) { |
+ var shortcuts = tooltip.shortcuts || WebInspector.shortcutRegistry.shortcutDescriptorsForAction(tooltip.actionId); |
+ for (var shortcut of shortcuts) { |
var shortcutElement = this._tooltipElement.createChild("div", "tooltip-shortcut"); |
- shortcutElement.textContent = shortcuts[0].name; |
+ shortcutElement.textContent = shortcut.name; |
} |
} |
@@ -135,11 +135,12 @@ WebInspector.Tooltip.installHandler = function(doc) |
* @param {!Element|string} tooltipContent |
* @param {string=} alignment |
* @param {string=} actionId |
+ * @param {!Array.<!WebInspector.KeyboardShortcut.Descriptor>=} shortcuts |
*/ |
-WebInspector.Tooltip.install = function(element, tooltipContent, alignment, actionId) |
+WebInspector.Tooltip.install = function(element, tooltipContent, alignment, actionId, shortcuts) |
{ |
if (Runtime.experiments.isEnabled("tooltips")) |
- element[WebInspector.Tooltip._symbol] = { content: tooltipContent, alignment: alignment, actionId: actionId }; |
+ element[WebInspector.Tooltip._symbol] = { content: tooltipContent, alignment: alignment, actionId: actionId, shortcuts: shortcuts }; |
else if (typeof tooltipContent === "string") |
element.title = tooltipContent; |
else |