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

Unified Diff: third_party/WebKit/Source/devtools/front_end/elements/EventListenersWidget.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/elements/EventListenersWidget.js
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/EventListenersWidget.js b/third_party/WebKit/Source/devtools/front_end/elements/EventListenersWidget.js
index 61ace324d0ada3abfe24b20fff63df36064265f5..86886ee248d6d5606f56fa33201a00b92c23e016 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/EventListenersWidget.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/EventListenersWidget.js
@@ -30,12 +30,13 @@
/**
* @constructor
* @extends {WebInspector.ThrottledWidget}
+ * @implements {WebInspector.ToolbarItem.ItemsProvider}
*/
WebInspector.EventListenersWidget = function()
{
WebInspector.ThrottledWidget.call(this);
this.element.classList.add("events-pane");
- var toolbar = new WebInspector.Toolbar("", this.contentElement);
+ this._toolbarItems = [];
this._showForAncestorsSetting = WebInspector.settings.moduleSetting("showEventListenersForAncestors");
this._showForAncestorsSetting.addChangeListener(this.update.bind(this));
@@ -49,8 +50,8 @@ WebInspector.EventListenersWidget = function()
var refreshButton = new WebInspector.ToolbarButton(WebInspector.UIString("Refresh"), "refresh-toolbar-item");
refreshButton.addEventListener("click", this.update.bind(this));
- toolbar.appendToolbarItem(refreshButton);
- toolbar.appendToolbarItem(new WebInspector.ToolbarCheckbox(WebInspector.UIString("Ancestors"), WebInspector.UIString("Show listeners on the ancestors"), this._showForAncestorsSetting));
+ this._toolbarItems.push(refreshButton);
+ this._toolbarItems.push(new WebInspector.ToolbarCheckbox(WebInspector.UIString("Ancestors"), WebInspector.UIString("Show listeners on the ancestors"), this._showForAncestorsSetting));
var dispatchFilter = new WebInspector.ToolbarComboBox(this._onDispatchFilterTypeChanged.bind(this));
/**
@@ -68,8 +69,8 @@ WebInspector.EventListenersWidget = function()
addDispatchFilterOption.call(this, WebInspector.UIString("Passive"), WebInspector.EventListenersWidget.DispatchFilterBy.Passive);
addDispatchFilterOption.call(this, WebInspector.UIString("Blocking"), WebInspector.EventListenersWidget.DispatchFilterBy.Blocking);
dispatchFilter.setMaxWidth(200);
- toolbar.appendToolbarItem(dispatchFilter);
- toolbar.appendToolbarItem(new WebInspector.ToolbarCheckbox(WebInspector.UIString("Framework listeners"), WebInspector.UIString("Resolve event listeners bound with framework"), this._showFrameworkListenersSetting));
+ this._toolbarItems.push(dispatchFilter);
+ this._toolbarItems.push(new WebInspector.ToolbarCheckbox(WebInspector.UIString("Framework listeners"), WebInspector.UIString("Resolve event listeners bound with framework"), this._showFrameworkListenersSetting));
WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this.update, this);
this.update();
@@ -118,6 +119,15 @@ WebInspector.EventListenersWidget.prototype = {
},
/**
+ * @override
+ * @return {!Array<!WebInspector.ToolbarItem>}
+ */
+ toolbarItems: function()
+ {
+ return this._toolbarItems;
+ },
+
+ /**
* @param {!Event} event
*/
_onDispatchFilterTypeChanged: function(event)

Powered by Google App Engine
This is Rietveld 408576698