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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js

Issue 2234193002: DevTools: migrate some of the sources panel sidebar panes to view management, allow view toolbars. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed Created 4 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
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);
/**

Powered by Google App Engine
This is Rietveld 408576698