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

Unified Diff: third_party/WebKit/Source/devtools/front_end/elements/EventListenersWidget.js

Issue 2493373002: DevTools: rename WebInspector into modules. (Closed)
Patch Set: for bots Created 4 years, 1 month 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 397cd5b6246399bf52e8986edb9cd067559938b9..6fbe037c5f7ef79ef63005dcb60fcf1a13373e49 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/EventListenersWidget.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/EventListenersWidget.js
@@ -27,38 +27,38 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
- * @implements {WebInspector.ToolbarItem.ItemsProvider}
+ * @implements {UI.ToolbarItem.ItemsProvider}
* @unrestricted
*/
-WebInspector.EventListenersWidget = class extends WebInspector.ThrottledWidget {
+Elements.EventListenersWidget = class extends UI.ThrottledWidget {
constructor() {
super();
this.element.classList.add('events-pane');
this._toolbarItems = [];
- this._showForAncestorsSetting = WebInspector.settings.moduleSetting('showEventListenersForAncestors');
+ this._showForAncestorsSetting = Common.settings.moduleSetting('showEventListenersForAncestors');
this._showForAncestorsSetting.addChangeListener(this.update.bind(this));
- this._dispatchFilterBySetting = WebInspector.settings.createSetting(
- 'eventListenerDispatchFilterType', WebInspector.EventListenersWidget.DispatchFilterBy.All);
+ this._dispatchFilterBySetting = Common.settings.createSetting(
+ 'eventListenerDispatchFilterType', Elements.EventListenersWidget.DispatchFilterBy.All);
this._dispatchFilterBySetting.addChangeListener(this.update.bind(this));
- this._showFrameworkListenersSetting = WebInspector.settings.createSetting('showFrameowkrListeners', true);
+ this._showFrameworkListenersSetting = Common.settings.createSetting('showFrameowkrListeners', true);
this._showFrameworkListenersSetting.addChangeListener(this._showFrameworkListenersChanged.bind(this));
- this._eventListenersView = new WebInspector.EventListenersView(this.element, this.update.bind(this));
+ this._eventListenersView = new Components.EventListenersView(this.element, this.update.bind(this));
- var refreshButton = new WebInspector.ToolbarButton(WebInspector.UIString('Refresh'), 'largeicon-refresh');
+ var refreshButton = new UI.ToolbarButton(Common.UIString('Refresh'), 'largeicon-refresh');
refreshButton.addEventListener('click', this.update.bind(this));
this._toolbarItems.push(refreshButton);
- this._toolbarItems.push(new WebInspector.ToolbarCheckbox(
- WebInspector.UIString('Ancestors'), WebInspector.UIString('Show listeners on the ancestors'),
+ this._toolbarItems.push(new UI.ToolbarCheckbox(
+ Common.UIString('Ancestors'), Common.UIString('Show listeners on the ancestors'),
this._showForAncestorsSetting));
- var dispatchFilter = new WebInspector.ToolbarComboBox(this._onDispatchFilterTypeChanged.bind(this));
+ var dispatchFilter = new UI.ToolbarComboBox(this._onDispatchFilterTypeChanged.bind(this));
/**
* @param {string} name
* @param {string} value
- * @this {WebInspector.EventListenersWidget}
+ * @this {Elements.EventListenersWidget}
*/
function addDispatchFilterOption(name, value) {
var option = dispatchFilter.createOption(name, '', value);
@@ -66,18 +66,18 @@ WebInspector.EventListenersWidget = class extends WebInspector.ThrottledWidget {
dispatchFilter.select(option);
}
addDispatchFilterOption.call(
- this, WebInspector.UIString('All'), WebInspector.EventListenersWidget.DispatchFilterBy.All);
+ this, Common.UIString('All'), Elements.EventListenersWidget.DispatchFilterBy.All);
addDispatchFilterOption.call(
- this, WebInspector.UIString('Passive'), WebInspector.EventListenersWidget.DispatchFilterBy.Passive);
+ this, Common.UIString('Passive'), Elements.EventListenersWidget.DispatchFilterBy.Passive);
addDispatchFilterOption.call(
- this, WebInspector.UIString('Blocking'), WebInspector.EventListenersWidget.DispatchFilterBy.Blocking);
+ this, Common.UIString('Blocking'), Elements.EventListenersWidget.DispatchFilterBy.Blocking);
dispatchFilter.setMaxWidth(200);
this._toolbarItems.push(dispatchFilter);
- this._toolbarItems.push(new WebInspector.ToolbarCheckbox(
- WebInspector.UIString('Framework listeners'),
- WebInspector.UIString('Resolve event listeners bound with framework'), this._showFrameworkListenersSetting));
+ this._toolbarItems.push(new UI.ToolbarCheckbox(
+ Common.UIString('Framework listeners'),
+ Common.UIString('Resolve event listeners bound with framework'), this._showFrameworkListenersSetting));
- WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this.update, this);
+ UI.context.addFlavorChangeListener(SDK.DOMNode, this.update, this);
this.update();
}
@@ -89,10 +89,10 @@ WebInspector.EventListenersWidget = class extends WebInspector.ThrottledWidget {
doUpdate() {
if (this._lastRequestedNode) {
this._lastRequestedNode.target().runtimeAgent().releaseObjectGroup(
- WebInspector.EventListenersWidget._objectGroupName);
+ Elements.EventListenersWidget._objectGroupName);
delete this._lastRequestedNode;
}
- var node = WebInspector.context.flavor(WebInspector.DOMNode);
+ var node = UI.context.flavor(SDK.DOMNode);
if (!node) {
this._eventListenersView.reset();
this._eventListenersView.addEmptyHolderIfNeeded();
@@ -102,11 +102,11 @@ WebInspector.EventListenersWidget = class extends WebInspector.ThrottledWidget {
var selectedNodeOnly = !this._showForAncestorsSetting.get();
var promises = [];
var listenersView = this._eventListenersView;
- promises.push(node.resolveToObjectPromise(WebInspector.EventListenersWidget._objectGroupName));
+ promises.push(node.resolveToObjectPromise(Elements.EventListenersWidget._objectGroupName));
if (!selectedNodeOnly) {
var currentNode = node.parentNode;
while (currentNode) {
- promises.push(currentNode.resolveToObjectPromise(WebInspector.EventListenersWidget._objectGroupName));
+ promises.push(currentNode.resolveToObjectPromise(Elements.EventListenersWidget._objectGroupName));
currentNode = currentNode.parentNode;
}
promises.push(this._windowObjectInNodeContext(node));
@@ -118,7 +118,7 @@ WebInspector.EventListenersWidget = class extends WebInspector.ThrottledWidget {
/**
* @override
- * @return {!Array<!WebInspector.ToolbarItem>}
+ * @return {!Array<!UI.ToolbarItem>}
*/
toolbarItems() {
return this._toolbarItems;
@@ -133,17 +133,17 @@ WebInspector.EventListenersWidget = class extends WebInspector.ThrottledWidget {
_showFrameworkListenersChanged() {
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;
+ var showPassive = dispatchFilter === Elements.EventListenersWidget.DispatchFilterBy.All ||
+ dispatchFilter === Elements.EventListenersWidget.DispatchFilterBy.Passive;
+ var showBlocking = dispatchFilter === Elements.EventListenersWidget.DispatchFilterBy.All ||
+ dispatchFilter === Elements.EventListenersWidget.DispatchFilterBy.Blocking;
this._eventListenersView.showFrameworkListeners(
this._showFrameworkListenersSetting.get(), showPassive, showBlocking);
}
/**
- * @param {!WebInspector.DOMNode} node
- * @return {!Promise<!WebInspector.RemoteObject>}
+ * @param {!SDK.DOMNode} node
+ * @return {!Promise<!SDK.RemoteObject>}
*/
_windowObjectInNodeContext(node) {
return new Promise(windowObjectInNodeContext);
@@ -165,7 +165,7 @@ WebInspector.EventListenersWidget = class extends WebInspector.ThrottledWidget {
context = executionContexts[0];
}
context.evaluate(
- 'self', WebInspector.EventListenersWidget._objectGroupName, false, true, false, false, false, fulfill);
+ 'self', Elements.EventListenersWidget._objectGroupName, false, true, false, false, false, fulfill);
}
}
@@ -173,10 +173,10 @@ WebInspector.EventListenersWidget = class extends WebInspector.ThrottledWidget {
}
};
-WebInspector.EventListenersWidget.DispatchFilterBy = {
+Elements.EventListenersWidget.DispatchFilterBy = {
All: 'All',
Blocking: 'Blocking',
Passive: 'Passive'
};
-WebInspector.EventListenersWidget._objectGroupName = 'event-listeners-panel';
+Elements.EventListenersWidget._objectGroupName = 'event-listeners-panel';

Powered by Google App Engine
This is Rietveld 408576698