Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js b/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js |
| index 9bc2472583d0c977f23a787057085c696870f9fb..6c42172eee90dd5c9003616b97738b8f71839b2f 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js |
| @@ -622,6 +622,16 @@ WebInspector.Toolbar.createActionButton = function(action, toggledOptions, untog |
| } |
| /** |
| + * @param {string} actionId |
| + * @return {?WebInspector.ToolbarItem} |
| + */ |
| +WebInspector.Toolbar.createActionButtonForId = function(actionId) |
| +{ |
| + var action = WebInspector.actionRegistry.action(actionId); |
| + return /** @type {?WebInspector.ToolbarItem} */(action ? WebInspector.Toolbar.createActionButton(action) : null) |
|
dgozman
2016/08/11 01:42:16
style: semicolon
|
| +} |
| + |
| +/** |
| * @constructor |
| * @extends {WebInspector.ToolbarButton} |
| * @param {function(!WebInspector.ContextMenu)} contextMenuHandler |
| @@ -747,6 +757,20 @@ WebInspector.ToolbarItem.Provider.prototype = { |
| } |
| /** |
| + * @interface |
| + */ |
| +WebInspector.ToolbarItem.ItemsProvider = function() |
| +{ |
| +} |
| + |
| +WebInspector.ToolbarItem.ItemsProvider.prototype = { |
| + /** |
| + * @return {!Array<!WebInspector.ToolbarItem>} |
| + */ |
| + toolbarItems: function() {} |
| +} |
| + |
| +/** |
| * @constructor |
| * @extends {WebInspector.ToolbarItem} |
| * @param {?function(!Event)} changeHandler |
| @@ -956,10 +980,8 @@ WebInspector.ExtensibleToolbar.prototype = { |
| var descriptor = extension.descriptor(); |
| if (descriptor["separator"]) |
| return Promise.resolve(/** @type {?WebInspector.ToolbarItem} */(new WebInspector.ToolbarSeparator())); |
| - if (descriptor["actionId"]) { |
| - var action = WebInspector.actionRegistry.action(descriptor["actionId"]); |
| - return Promise.resolve(/** @type {?WebInspector.ToolbarItem} */(action ? WebInspector.Toolbar.createActionButton(action) : null)); |
| - } |
| + if (descriptor["actionId"]) |
| + return Promise.resolve(WebInspector.Toolbar.createActionButtonForId(descriptor["actionId"])); |
| return extension.instance().then(fetchItemFromProvider); |
| /** |