OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 | 606 |
607 __proto__: WebInspector.SDKObject.prototype | 607 __proto__: WebInspector.SDKObject.prototype |
608 } | 608 } |
609 | 609 |
610 /** | 610 /** |
611 * @constructor | 611 * @constructor |
612 * @extends {WebInspector.SDKObject} | 612 * @extends {WebInspector.SDKObject} |
613 * @param {!WebInspector.Target} target | 613 * @param {!WebInspector.Target} target |
614 * @param {string} type | 614 * @param {string} type |
615 * @param {boolean} useCapture | 615 * @param {boolean} useCapture |
| 616 * @param {boolean} passive |
616 * @param {?WebInspector.RemoteObject} handler | 617 * @param {?WebInspector.RemoteObject} handler |
617 * @param {?WebInspector.RemoteObject} originalHandler | 618 * @param {?WebInspector.RemoteObject} originalHandler |
618 * @param {!WebInspector.DebuggerModel.Location} location | 619 * @param {!WebInspector.DebuggerModel.Location} location |
619 * @param {?WebInspector.RemoteObject} removeFunction | 620 * @param {?WebInspector.RemoteObject} removeFunction |
620 * @param {string=} listenerType | 621 * @param {string=} listenerType |
621 */ | 622 */ |
622 WebInspector.EventListener = function(target, type, useCapture, handler, origina
lHandler, location, removeFunction, listenerType) | 623 WebInspector.EventListener = function(target, type, useCapture, passive, handler
, originalHandler, location, removeFunction, listenerType) |
623 { | 624 { |
624 WebInspector.SDKObject.call(this, target); | 625 WebInspector.SDKObject.call(this, target); |
625 this._type = type; | 626 this._type = type; |
626 this._useCapture = useCapture; | 627 this._useCapture = useCapture; |
| 628 this._passive = passive; |
627 this._handler = handler; | 629 this._handler = handler; |
628 this._originalHandler = originalHandler || handler; | 630 this._originalHandler = originalHandler || handler; |
629 this._location = location; | 631 this._location = location; |
630 var script = location.script(); | 632 var script = location.script(); |
631 this._sourceURL = script ? script.contentURL() : ""; | 633 this._sourceURL = script ? script.contentURL() : ""; |
632 this._removeFunction = removeFunction; | 634 this._removeFunction = removeFunction; |
633 this._listenerType = listenerType || "normal"; | 635 this._listenerType = listenerType || "normal"; |
634 } | 636 } |
635 | 637 |
636 WebInspector.EventListener.prototype = { | 638 WebInspector.EventListener.prototype = { |
637 /** | 639 /** |
638 * @return {string} | 640 * @return {string} |
639 */ | 641 */ |
640 type: function() | 642 type: function() |
641 { | 643 { |
642 return this._type; | 644 return this._type; |
643 }, | 645 }, |
644 | 646 |
645 /** | 647 /** |
646 * @return {boolean} | 648 * @return {boolean} |
647 */ | 649 */ |
648 useCapture: function() | 650 useCapture: function() |
649 { | 651 { |
650 return this._useCapture; | 652 return this._useCapture; |
651 }, | 653 }, |
652 | 654 |
653 /** | 655 /** |
| 656 * @return {boolean} |
| 657 */ |
| 658 passive: function() |
| 659 { |
| 660 return this._passive; |
| 661 }, |
| 662 |
| 663 /** |
654 * @return {?WebInspector.RemoteObject} | 664 * @return {?WebInspector.RemoteObject} |
655 */ | 665 */ |
656 handler: function() | 666 handler: function() |
657 { | 667 { |
658 return this._handler; | 668 return this._handler; |
659 }, | 669 }, |
660 | 670 |
661 /** | 671 /** |
662 * @return {!WebInspector.DebuggerModel.Location} | 672 * @return {!WebInspector.DebuggerModel.Location} |
663 */ | 673 */ |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 /** | 712 /** |
703 * @param {function()} success | 713 * @param {function()} success |
704 * @this {WebInspector.EventListener} | 714 * @this {WebInspector.EventListener} |
705 */ | 715 */ |
706 function promiseConstructor(success) | 716 function promiseConstructor(success) |
707 { | 717 { |
708 this._removeFunction.callFunction(callCustomRemove, [ | 718 this._removeFunction.callFunction(callCustomRemove, [ |
709 WebInspector.RemoteObject.toCallArgument(this._removeFunction), | 719 WebInspector.RemoteObject.toCallArgument(this._removeFunction), |
710 WebInspector.RemoteObject.toCallArgument(this._type), | 720 WebInspector.RemoteObject.toCallArgument(this._type), |
711 WebInspector.RemoteObject.toCallArgument(this._originalHandler), | 721 WebInspector.RemoteObject.toCallArgument(this._originalHandler), |
712 WebInspector.RemoteObject.toCallArgument(this._useCapture) | 722 WebInspector.RemoteObject.toCallArgument(this._useCapture), |
| 723 WebInspector.RemoteObject.toCallArgument(this._passive), |
713 ], success); | 724 ], success); |
714 | 725 |
715 /** | 726 /** |
716 * @param {function(string, function(), boolean)} func | 727 * @param {function(string, function(), boolean, boolean)} func |
717 * @param {string} type | 728 * @param {string} type |
718 * @param {function()} listener | 729 * @param {function()} listener |
719 * @param {boolean} useCapture | 730 * @param {boolean} useCapture |
| 731 * @param {boolean} passive |
720 */ | 732 */ |
721 function callCustomRemove(func, type, listener, useCapture) | 733 function callCustomRemove(func, type, listener, useCapture, passive) |
722 { | 734 { |
723 func.call(null, type, listener, useCapture); | 735 func.call(null, type, listener, useCapture, passive); |
724 } | 736 } |
725 } | 737 } |
726 }, | 738 }, |
727 | 739 |
728 /** | 740 /** |
729 * @return {string} | 741 * @return {string} |
730 */ | 742 */ |
731 listenerType: function() | 743 listenerType: function() |
732 { | 744 { |
733 return this._listenerType; | 745 return this._listenerType; |
734 }, | 746 }, |
735 | 747 |
736 /** | 748 /** |
737 * @param {string} listenerType | 749 * @param {string} listenerType |
738 */ | 750 */ |
739 setListenerType: function(listenerType) | 751 setListenerType: function(listenerType) |
740 { | 752 { |
741 this._listenerType = listenerType; | 753 this._listenerType = listenerType; |
742 }, | 754 }, |
743 | 755 |
744 __proto__: WebInspector.SDKObject.prototype | 756 __proto__: WebInspector.SDKObject.prototype |
745 } | 757 } |
OLD | NEW |