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

Unified Diff: Source/devtools/front_end/ui/Toolbar.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/KeyboardShortcut.js ('k') | Source/devtools/front_end/ui/Tooltip.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/Toolbar.js
diff --git a/Source/devtools/front_end/ui/Toolbar.js b/Source/devtools/front_end/ui/Toolbar.js
index 4a1888e7956c964ef4e09730594c2895514740cd..c63f623e5a3c2836019e27b7c311a23c49ffe4dd 100644
--- a/Source/devtools/front_end/ui/Toolbar.js
+++ b/Source/devtools/front_end/ui/Toolbar.js
@@ -404,7 +404,21 @@ WebInspector.ToolbarButtonBase.prototype = {
setAction: function(actionId)
{
this._actionId = actionId;
- WebInspector.Tooltip.install(this.element, this._title, undefined, this._actionId);
+ this._updateTooltip();
+ },
+
+ /**
+ * @param {!Array.<!WebInspector.KeyboardShortcut.Descriptor>} keys
+ */
+ setShortcut: function(keys)
+ {
+ this._shortcutKeys = keys;
pfeldman 2015/08/11 05:34:56 We should have action ids for everything with the
samli 2015/08/11 07:17:01 Done.
+ this._updateTooltip();
+ },
+
+ _updateTooltip: function()
+ {
+ WebInspector.Tooltip.install(this.element, this._title, undefined, this._actionId, this._shortcutKeys);
},
/**
@@ -440,7 +454,7 @@ WebInspector.ToolbarButtonBase.prototype = {
if (this._title === title)
return;
this._title = title;
- WebInspector.Tooltip.install(this.element, title, undefined, this._actionId);
+ this._updateTooltip();
},
/**
« no previous file with comments | « Source/devtools/front_end/ui/KeyboardShortcut.js ('k') | Source/devtools/front_end/ui/Tooltip.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698