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

Unified Diff: Source/devtools/front_end/sdk/Target.js

Issue 1042853004: [DevTools] Event Listeners Sidebar shows window listeners (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Extracted eventListenersTreeOutline.css Created 5 years, 8 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
« no previous file with comments | « Source/devtools/front_end/sdk/RuntimeModel.js ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sdk/Target.js
diff --git a/Source/devtools/front_end/sdk/Target.js b/Source/devtools/front_end/sdk/Target.js
index 078ac8a2994dfe7e765f1ee1d24429c0f1f29c24..d5e3786a0f178f476be48c878b2c4643669ec19e 100644
--- a/Source/devtools/front_end/sdk/Target.js
+++ b/Source/devtools/front_end/sdk/Target.js
@@ -607,6 +607,99 @@ WebInspector.TargetManager.Observer.prototype = {
}
/**
+ * @constructor
+ * @extends {WebInspector.SDKObject}
+ * @template ProtocolEventListener
+ * @param {!WebInspector.Target} target
+ * @param {!ProtocolEventListener} payload
+ */
+WebInspector.EventListener = function(target, payload)
+{
+ WebInspector.SDKObject.call(this, target);
+ this._payload = payload;
+ var script = target.debuggerModel.scriptForId(payload.location.scriptId);
+ var sourceName = script ? script.contentURL() : "";
+ this._sourceName = sourceName;
+}
+
+WebInspector.EventListener.prototype = {
+ /**
+ * @return {boolean}
+ */
+ isObjectEventListener: function()
+ {
+ return false;
+ },
+
+ /**
+ * @return {boolean}
+ */
+ isDOMEventListener: function()
+ {
+ return false;
+ },
+
+ /**
+ * @return {string}
+ */
+ type: function()
+ {
+ return this._payload.type;
+ },
+
+ /**
+ * @return {!ProtocolEventListener}
+ */
+ payload: function()
+ {
+ return this._payload;
+ },
+
+ /**
+ * @return {!WebInspector.DebuggerModel.Location}
+ */
+ location: function()
+ {
+ return WebInspector.DebuggerModel.Location.fromPayload(this.target(), this._payload.location);
+ },
+
+ /**
+ * @return {?WebInspector.RemoteObject}
+ */
+ handler: function()
+ {
+ return this._payload.handler ? this.target().runtimeModel.createRemoteObject(this._payload.handler) : null;
+ },
+
+ /**
+ * @return {string}
+ */
+ sourceName: function()
+ {
+ return this._sourceName;
+ },
+
+ /**
+ * @param {function(!Array<!WebInspector.RemoteObjectProperty>)} callback
+ * @param {string} objectGroupName
+ */
+ getProperties: function(callback, objectGroupName)
+ {
+ var properties = [];
+ var runtimeModel = this.target().runtimeModel;
+
+ properties.push(runtimeModel.createRemotePropertyFromPrimitiveValue("useCapture", this._payload.useCapture));
+ if (typeof this._payload.handler !== "undefined") {
+ var remoteObject = runtimeModel.createRemoteObject(this._payload.handler);
+ properties.push(new WebInspector.RemoteObjectProperty("handler", remoteObject));
+ }
+ callback(properties);
+ },
+
+ __proto__: WebInspector.SDKObject.prototype
+}
+
+/**
* @type {!WebInspector.TargetManager}
*/
WebInspector.targetManager = new WebInspector.TargetManager();
« no previous file with comments | « Source/devtools/front_end/sdk/RuntimeModel.js ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698