OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
145 */ | 145 */ |
146 appendCustomItem: function(element) | 146 appendCustomItem: function(element) |
147 { | 147 { |
148 var item = new WebInspector.ContextMenuItem(this._contextMenu, "item", " <custom>"); | 148 var item = new WebInspector.ContextMenuItem(this._contextMenu, "item", " <custom>"); |
149 item._customElement = element; | 149 item._customElement = element; |
150 this._pushItem(item); | 150 this._pushItem(item); |
151 return item; | 151 return item; |
152 }, | 152 }, |
153 | 153 |
154 /** | 154 /** |
155 * @param {string} label | |
156 * @param {string} actionId | 155 * @param {string} actionId |
156 * @param {string=} label | |
157 * @return {!WebInspector.ContextMenuItem} | 157 * @return {!WebInspector.ContextMenuItem} |
158 */ | 158 */ |
159 appendAction: function(label, actionId) | 159 appendAction: function(actionId, label) |
pfeldman
2015/08/18 05:08:31
Lets remove the label where possible and migrate t
samli
2015/08/19 05:27:15
Done. Can't remove fully since Main.js:845 overrid
| |
160 { | 160 { |
161 if (!label) | |
162 label = WebInspector.actionRegistry.getActionDescriptor(actionId).ti tle; | |
161 var result = this.appendItem(label, WebInspector.actionRegistry.execute. bind(WebInspector.actionRegistry, actionId)); | 163 var result = this.appendItem(label, WebInspector.actionRegistry.execute. bind(WebInspector.actionRegistry, actionId)); |
162 var shortcut = WebInspector.shortcutRegistry.shortcutTitleForAction(acti onId); | 164 var shortcut = WebInspector.shortcutRegistry.shortcutTitleForAction(acti onId); |
163 if (shortcut) | 165 if (shortcut) |
164 result.setShortcut(shortcut); | 166 result.setShortcut(shortcut); |
165 return result; | 167 return result; |
166 }, | 168 }, |
167 | 169 |
168 /** | 170 /** |
169 * @param {string} label | 171 * @param {string} label |
170 * @param {boolean=} disabled | 172 * @param {boolean=} disabled |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
428 if (groupWeights.indexOf(itemGroup) === -1) | 430 if (groupWeights.indexOf(itemGroup) === -1) |
429 groupWeights.splice(4, 0, itemGroup); | 431 groupWeights.splice(4, 0, itemGroup); |
430 } | 432 } |
431 group.push(extension); | 433 group.push(extension); |
432 } | 434 } |
433 for (var groupName of groupWeights) { | 435 for (var groupName of groupWeights) { |
434 var group = groups.get(groupName); | 436 var group = groups.get(groupName); |
435 if (!group) | 437 if (!group) |
436 continue; | 438 continue; |
437 for (var extension of group) | 439 for (var extension of group) |
438 this.appendAction(extension.title(), extension.descriptor()["act ionId"]); | 440 this.appendAction(extension.descriptor()["actionId"], extension. title()); |
439 this.appendSeparator(); | 441 this.appendSeparator(); |
440 } | 442 } |
441 }, | 443 }, |
442 | 444 |
443 __proto__: WebInspector.ContextSubMenuItem.prototype | 445 __proto__: WebInspector.ContextSubMenuItem.prototype |
444 } | 446 } |
445 | 447 |
446 /** | 448 /** |
447 * @interface | 449 * @interface |
448 */ | 450 */ |
449 WebInspector.ContextMenu.Provider = function() { | 451 WebInspector.ContextMenu.Provider = function() { |
450 } | 452 } |
451 | 453 |
452 WebInspector.ContextMenu.Provider.prototype = { | 454 WebInspector.ContextMenu.Provider.prototype = { |
453 /** | 455 /** |
454 * @param {!Event} event | 456 * @param {!Event} event |
455 * @param {!WebInspector.ContextMenu} contextMenu | 457 * @param {!WebInspector.ContextMenu} contextMenu |
456 * @param {!Object} target | 458 * @param {!Object} target |
457 */ | 459 */ |
458 appendApplicableItems: function(event, contextMenu, target) { } | 460 appendApplicableItems: function(event, contextMenu, target) { } |
459 } | 461 } |
OLD | NEW |