Chromium Code Reviews| 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 efbf6506b8c3be2959cd58228fbec1310eac71ed..369a0681cedf0c7cae9ad39a03c8b5b74f80bb8d 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/elements/EventListenersWidget.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/elements/EventListenersWidget.js |
| @@ -38,12 +38,22 @@ WebInspector.EventListenersWidget = function() |
| this._showForAncestorsSetting = WebInspector.settings.createSetting("showEventListenersForAncestors", true); |
| this._showForAncestorsSetting.addChangeListener(this.update.bind(this)); |
| + |
| + this._dispatchFilterBySetting = WebInspector.settings.createSetting("eventListenerDispatchFilterType", WebInspector.EventListenersWidget.DispatchFilterBy.All); |
| + this._dispatchFilterBySetting.addChangeListener(this.update.bind(this)); |
| + |
| this._showFrameworkListenersSetting = WebInspector.settings.createSetting("showFrameowkrListeners", true); |
| this._showFrameworkListenersSetting.addChangeListener(this._showFrameworkListenersChanged.bind(this)); |
| this._eventListenersView = new WebInspector.EventListenersView(this.element); |
| WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this.update, this); |
| } |
| +WebInspector.EventListenersWidget.DispatchFilterBy = { |
| + All : "All", |
| + Blocking : "Blocking", |
| + Passive : "Passive" |
| +} |
| + |
| /** |
| * @return {!WebInspector.ElementsSidebarViewWrapperPane} |
| */ |
| @@ -55,6 +65,18 @@ WebInspector.EventListenersWidget.createSidebarWrapper = function() |
| refreshButton.addEventListener("click", widget.update.bind(widget)); |
| result.toolbar().appendToolbarItem(refreshButton); |
| result.toolbar().appendToolbarItem(new WebInspector.ToolbarCheckbox(WebInspector.UIString("Ancestors"), WebInspector.UIString("Show listeners on the ancestors"), widget._showForAncestorsSetting)); |
| + var dispatchFilter = new WebInspector.ToolbarComboBox(widget._onDispatchFilterTypeChanged.bind(widget)); |
| + function addDispatchFilterOption(name, value) { |
|
pfeldman
2016/03/30 17:43:04
This function needs JSDoc annotations. { should go
dtapuska
2016/03/30 20:59:47
Done.
|
| + var option = dispatchFilter.createOption(name, "", value); |
| + if (value === widget._dispatchFilterBySetting.get()) |
| + dispatchFilter.select(option); |
| + } |
| + addDispatchFilterOption(WebInspector.UIString("All"), WebInspector.EventListenersWidget.DispatchFilterBy.All); |
| + addDispatchFilterOption(WebInspector.UIString("Passive"), WebInspector.EventListenersWidget.DispatchFilterBy.Passive); |
| + addDispatchFilterOption(WebInspector.UIString("Blocking"), WebInspector.EventListenersWidget.DispatchFilterBy.Blocking); |
| + dispatchFilter.setMaxWidth(200); |
|
pfeldman
2016/03/30 17:43:04
For UI changes, please attach the screenshot to th
dtapuska
2016/03/30 20:59:47
Done.
|
| + result.toolbar().appendToolbarItem(dispatchFilter); |
| + |
| result.toolbar().appendToolbarItem(new WebInspector.ToolbarCheckbox(WebInspector.UIString("Framework listeners"), WebInspector.UIString("Resolve event listeners bound with framework"), widget._showFrameworkListenersSetting)); |
| return result; |
| } |
| @@ -95,10 +117,17 @@ WebInspector.EventListenersWidget.prototype = { |
| return Promise.all(promises).then(this._eventListenersView.addObjects.bind(this._eventListenersView)).then(this._showFrameworkListenersChanged.bind(this)); |
| }, |
| + _onDispatchFilterTypeChanged: function(event) |
|
pfeldman
2016/03/30 17:43:04
JSDoc missing
dtapuska
2016/03/30 20:59:47
Done.
|
| + { |
| + this._dispatchFilterBySetting.set(event.target.value); |
| + }, |
| _showFrameworkListenersChanged: function() |
| { |
| - this._eventListenersView.showFrameworkListeners(this._showFrameworkListenersSetting.get()); |
| + var dispatchFilter = this._dispatchFilterBySetting.get(); |
| + var showPassive = dispatchFilter == WebInspector.EventListenersWidget.DispatchFilterBy.All || dispatchFilter == WebInspector.EventListenersWidget.DispatchFilterBy.Passive; |
| + var showBlocking = dispatchFilter == WebInspector.EventListenersWidget.DispatchFilterBy.All || dispatchFilter == WebInspector.EventListenersWidget.DispatchFilterBy.Blocking; |
| + this._eventListenersView.showFrameworkListeners(this._showFrameworkListenersSetting.get(), showPassive, showBlocking); |
| }, |
| /** |