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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 The Chromium Authors. All rights reserved. 2 * Copyright 2014 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /** 7 /**
8 * @constructor 8 * @constructor
9 * @extends {Protocol.Agents} 9 * @extends {Protocol.Agents}
10 * @param {string} name 10 * @param {string} name
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 */ 600 */
601 targetAdded: function(target) { }, 601 targetAdded: function(target) { },
602 602
603 /** 603 /**
604 * @param {!WebInspector.Target} target 604 * @param {!WebInspector.Target} target
605 */ 605 */
606 targetRemoved: function(target) { }, 606 targetRemoved: function(target) { },
607 } 607 }
608 608
609 /** 609 /**
610 * @constructor
611 * @extends {WebInspector.SDKObject}
612 * @template ProtocolEventListener
613 * @param {!WebInspector.Target} target
614 * @param {!ProtocolEventListener} payload
615 */
616 WebInspector.EventListener = function(target, payload)
617 {
618 WebInspector.SDKObject.call(this, target);
619 this._payload = payload;
620 var script = target.debuggerModel.scriptForId(payload.location.scriptId);
621 var sourceName = script ? script.contentURL() : "";
622 this._sourceName = sourceName;
623 }
624
625 WebInspector.EventListener.prototype = {
626 /**
627 * @return {boolean}
628 */
629 isObjectEventListener: function()
630 {
631 return false;
632 },
633
634 /**
635 * @return {boolean}
636 */
637 isDOMEventListener: function()
638 {
639 return false;
640 },
641
642 /**
643 * @return {string}
644 */
645 type: function()
646 {
647 return this._payload.type;
648 },
649
650 /**
651 * @return {!ProtocolEventListener}
652 */
653 payload: function()
654 {
655 return this._payload;
656 },
657
658 /**
659 * @return {!WebInspector.DebuggerModel.Location}
660 */
661 location: function()
662 {
663 return WebInspector.DebuggerModel.Location.fromPayload(this.target(), th is._payload.location);
664 },
665
666 /**
667 * @return {?WebInspector.RemoteObject}
668 */
669 handler: function()
670 {
671 return this._payload.handler ? this.target().runtimeModel.createRemoteOb ject(this._payload.handler) : null;
672 },
673
674 /**
675 * @return {string}
676 */
677 sourceName: function()
678 {
679 return this._sourceName;
680 },
681
682 /**
683 * @param {function(!Array<!WebInspector.RemoteObjectProperty>)} callback
684 * @param {string} objectGroupName
685 */
686 getProperties: function(callback, objectGroupName)
687 {
688 var properties = [];
689 var runtimeModel = this.target().runtimeModel;
690
691 properties.push(runtimeModel.createRemotePropertyFromPrimitiveValue("use Capture", this._payload.useCapture));
692 if (typeof this._payload.handler !== "undefined") {
693 var remoteObject = runtimeModel.createRemoteObject(this._payload.han dler);
694 properties.push(new WebInspector.RemoteObjectProperty("handler", rem oteObject));
695 }
696 callback(properties);
697 },
698
699 __proto__: WebInspector.SDKObject.prototype
700 }
701
702 /**
610 * @type {!WebInspector.TargetManager} 703 * @type {!WebInspector.TargetManager}
611 */ 704 */
612 WebInspector.targetManager = new WebInspector.TargetManager(); 705 WebInspector.targetManager = new WebInspector.TargetManager();
OLDNEW
« 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