| 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..584a011a526f0ed11a0479a81ee6aa231761b196 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);
|
| +}
|
| +
|
| +/**
|
| * @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);
|
|
|
| /**
|
|
|