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

Unified Diff: Source/devtools/front_end/sdk/RemoteObject.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/DOMModel.js ('k') | Source/devtools/front_end/sdk/RuntimeModel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sdk/RemoteObject.js
diff --git a/Source/devtools/front_end/sdk/RemoteObject.js b/Source/devtools/front_end/sdk/RemoteObject.js
index f7e7a69697aba5e38eb7af8fa7ea748ba9058f57..4ed59d0d78f46a41958165fdf8303b023eb56b55 100644
--- a/Source/devtools/front_end/sdk/RemoteObject.js
+++ b/Source/devtools/front_end/sdk/RemoteObject.js
@@ -95,6 +95,15 @@ WebInspector.RemoteObject.prototype = {
},
/**
+ * @param {string} objectGroupName
+ * @param {function(?Array<!WebInspector.RuntimeModel.ObjectEventListener>)} callback
+ */
+ getEventListeners: function(objectGroupName, callback)
+ {
+ throw "Not implemented";
+ },
+
+ /**
* @param {!RuntimeAgent.CallArgument} name
* @param {function(string=)} callback
*/
@@ -374,6 +383,42 @@ WebInspector.RemoteObjectImpl.prototype = {
},
/**
+ * @override
+ * @param {string} objectGroupName
+ * @param {function(?Array<!WebInspector.RuntimeModel.ObjectEventListener>)} callback
+ */
+ getEventListeners: function(objectGroupName, callback)
+ {
+ if (!this._objectId) {
+ callback(null);
+ return;
+ }
+ var description = this.description;
+ /**
+ * @this {!WebInspector.RemoteObject}
+ * @param {?Protocol.Error} error
+ * @param {!Array.<!RuntimeAgent.EventListener>} payloads
+ */
+ function mycallback(error, payloads)
+ {
+ if (error) {
+ callback(null);
+ return;
+ }
+ callback(payloads.map(createEventListener.bind(this)));
+ }
+ /**
+ * @this {!WebInspector.RemoteObject}
+ * @param {!RuntimeAgent.EventListener} payload
+ */
+ function createEventListener(payload)
+ {
+ return new WebInspector.RuntimeModel.ObjectEventListener(this._target, payload, this.description || "Object");
+ }
+ this._runtimeAgent.getEventListeners(this._objectId, objectGroupName, mycallback.bind(this));
+ },
+
+ /**
* @param {!Array.<string>} propertyPath
* @param {function(?WebInspector.RemoteObject, boolean=)} callback
*/
« no previous file with comments | « Source/devtools/front_end/sdk/DOMModel.js ('k') | Source/devtools/front_end/sdk/RuntimeModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698