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

Side by Side Diff: Source/devtools/front_end/sdk/DOMModel.js

Issue 369853002: DevTools: Rename TargetAwareObject into SDKObject (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 13 matching lines...) Expand all
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32 /** 32 /**
33 * @constructor 33 * @constructor
34 * @extends {WebInspector.TargetAware} 34 * @extends {WebInspector.SDKObject}
35 * @param {!WebInspector.DOMModel} domModel 35 * @param {!WebInspector.DOMModel} domModel
36 * @param {?WebInspector.DOMDocument} doc 36 * @param {?WebInspector.DOMDocument} doc
37 * @param {boolean} isInShadowTree 37 * @param {boolean} isInShadowTree
38 * @param {!DOMAgent.Node} payload 38 * @param {!DOMAgent.Node} payload
39 */ 39 */
40 WebInspector.DOMNode = function(domModel, doc, isInShadowTree, payload) { 40 WebInspector.DOMNode = function(domModel, doc, isInShadowTree, payload) {
41 WebInspector.TargetAware.call(this, domModel.target()); 41 WebInspector.SDKObject.call(this, domModel.target());
42 this._domModel = domModel; 42 this._domModel = domModel;
43 this._agent = domModel._agent; 43 this._agent = domModel._agent;
44 this.ownerDocument = doc; 44 this.ownerDocument = doc;
45 this._isInShadowTree = isInShadowTree; 45 this._isInShadowTree = isInShadowTree;
46 46
47 this.id = payload.nodeId; 47 this.id = payload.nodeId;
48 domModel._idToDOMNode[this.id] = this; 48 domModel._idToDOMNode[this.id] = this;
49 this._nodeType = payload.nodeType; 49 this._nodeType = payload.nodeType;
50 this._nodeName = payload.nodeName; 50 this._nodeName = payload.nodeName;
51 this._localName = payload.localName; 51 this._localName = payload.localName;
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 }, 854 },
855 855
856 /** 856 /**
857 * @param {function(?DOMAgent.BoxModel)} callback 857 * @param {function(?DOMAgent.BoxModel)} callback
858 */ 858 */
859 boxModel: function(callback) 859 boxModel: function(callback)
860 { 860 {
861 this._agent.getBoxModel(this.id, this._domModel._wrapClientCallback(call back)); 861 this._agent.getBoxModel(this.id, this._domModel._wrapClientCallback(call back));
862 }, 862 },
863 863
864 __proto__: WebInspector.TargetAware.prototype 864 __proto__: WebInspector.SDKObject.prototype
865 } 865 }
866 866
867 /** 867 /**
868 * @extends {WebInspector.DOMNode} 868 * @extends {WebInspector.DOMNode}
869 * @constructor 869 * @constructor
870 * @param {!WebInspector.DOMModel} domModel 870 * @param {!WebInspector.DOMModel} domModel
871 * @param {!DOMAgent.Node} payload 871 * @param {!DOMAgent.Node} payload
872 */ 872 */
873 WebInspector.DOMDocument = function(domModel, payload) 873 WebInspector.DOMDocument = function(domModel, payload)
874 { 874 {
875 WebInspector.DOMNode.call(this, domModel, this, false, payload); 875 WebInspector.DOMNode.call(this, domModel, this, false, payload);
876 this.documentURL = payload.documentURL || ""; 876 this.documentURL = payload.documentURL || "";
877 this.baseURL = payload.baseURL || ""; 877 this.baseURL = payload.baseURL || "";
878 this.xmlVersion = payload.xmlVersion; 878 this.xmlVersion = payload.xmlVersion;
879 this._listeners = {}; 879 this._listeners = {};
880 } 880 }
881 881
882 WebInspector.DOMDocument.prototype = { 882 WebInspector.DOMDocument.prototype = {
883 __proto__: WebInspector.DOMNode.prototype 883 __proto__: WebInspector.DOMNode.prototype
884 } 884 }
885 885
886 /** 886 /**
887 * @constructor 887 * @constructor
888 * @extends {WebInspector.TargetAwareObject} 888 * @extends {WebInspector.SDKObject}
889 * @param {!WebInspector.Target} target 889 * @param {!WebInspector.Target} target
890 */ 890 */
891 WebInspector.DOMModel = function(target) { 891 WebInspector.DOMModel = function(target) {
892 WebInspector.TargetAwareObject.call(this, target); 892 WebInspector.SDKObject.call(this, target);
893 893
894 this._agent = target.domAgent(); 894 this._agent = target.domAgent();
895 895
896 /** @type {!Object.<number, !WebInspector.DOMNode>} */ 896 /** @type {!Object.<number, !WebInspector.DOMNode>} */
897 this._idToDOMNode = {}; 897 this._idToDOMNode = {};
898 /** @type {?WebInspector.DOMDocument} */ 898 /** @type {?WebInspector.DOMDocument} */
899 this._document = null; 899 this._document = null;
900 /** @type {!Object.<number, boolean>} */ 900 /** @type {!Object.<number, boolean>} */
901 this._attributeLoadNodeIds = {}; 901 this._attributeLoadNodeIds = {};
902 target.registerDOMDispatcher(new WebInspector.DOMDispatcher(this)); 902 target.registerDOMDispatcher(new WebInspector.DOMDispatcher(this));
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
1621 function mycallback(error, nodeId) 1621 function mycallback(error, nodeId)
1622 { 1622 {
1623 if (error) { 1623 if (error) {
1624 callback(null); 1624 callback(null);
1625 return; 1625 return;
1626 } 1626 }
1627 callback(this.nodeForId(nodeId)); 1627 callback(this.nodeForId(nodeId));
1628 } 1628 }
1629 }, 1629 },
1630 1630
1631 __proto__: WebInspector.TargetAwareObject.prototype 1631 __proto__: WebInspector.SDKObject.prototype
1632 } 1632 }
1633 1633
1634 /** 1634 /**
1635 * @constructor 1635 * @constructor
1636 * @implements {DOMAgent.Dispatcher} 1636 * @implements {DOMAgent.Dispatcher}
1637 * @param {!WebInspector.DOMModel} domModel 1637 * @param {!WebInspector.DOMModel} domModel
1638 */ 1638 */
1639 WebInspector.DOMDispatcher = function(domModel) 1639 WebInspector.DOMDispatcher = function(domModel)
1640 { 1640 {
1641 this._domModel = domModel; 1641 this._domModel = domModel;
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1760 * @param {!DOMAgent.NodeId} pseudoElementId 1760 * @param {!DOMAgent.NodeId} pseudoElementId
1761 */ 1761 */
1762 pseudoElementRemoved: function(parentId, pseudoElementId) 1762 pseudoElementRemoved: function(parentId, pseudoElementId)
1763 { 1763 {
1764 this._domModel._pseudoElementRemoved(parentId, pseudoElementId); 1764 this._domModel._pseudoElementRemoved(parentId, pseudoElementId);
1765 } 1765 }
1766 } 1766 }
1767 1767
1768 /** 1768 /**
1769 * @constructor 1769 * @constructor
1770 * @extends {WebInspector.TargetAware} 1770 * @extends {WebInspector.SDKObject}
1771 * @param {!WebInspector.Target} target 1771 * @param {!WebInspector.Target} target
1772 * @param {!DOMAgent.EventListener} payload 1772 * @param {!DOMAgent.EventListener} payload
1773 */ 1773 */
1774 WebInspector.DOMModel.EventListener = function(target, payload) 1774 WebInspector.DOMModel.EventListener = function(target, payload)
1775 { 1775 {
1776 WebInspector.TargetAware.call(this, target); 1776 WebInspector.SDKObject.call(this, target);
1777 this._payload = payload; 1777 this._payload = payload;
1778 } 1778 }
1779 1779
1780 WebInspector.DOMModel.EventListener.prototype = { 1780 WebInspector.DOMModel.EventListener.prototype = {
1781 /** 1781 /**
1782 * @return {!DOMAgent.EventListener} 1782 * @return {!DOMAgent.EventListener}
1783 */ 1783 */
1784 payload: function() 1784 payload: function()
1785 { 1785 {
1786 return this._payload; 1786 return this._payload;
(...skipping 16 matching lines...) Expand all
1803 }, 1803 },
1804 1804
1805 /** 1805 /**
1806 * @return {?WebInspector.RemoteObject} 1806 * @return {?WebInspector.RemoteObject}
1807 */ 1807 */
1808 handler: function() 1808 handler: function()
1809 { 1809 {
1810 return this._payload.handler ? this.target().runtimeModel.createRemoteOb ject(this._payload.handler) : null; 1810 return this._payload.handler ? this.target().runtimeModel.createRemoteOb ject(this._payload.handler) : null;
1811 }, 1811 },
1812 1812
1813 __proto__: WebInspector.TargetAware.prototype 1813 __proto__: WebInspector.SDKObject.prototype
1814 } 1814 }
1815 1815
1816 /** 1816 /**
1817 * @interface 1817 * @interface
1818 */ 1818 */
1819 WebInspector.DOMNodeHighlighter = function() { 1819 WebInspector.DOMNodeHighlighter = function() {
1820 } 1820 }
1821 1821
1822 WebInspector.DOMNodeHighlighter.prototype = { 1822 WebInspector.DOMNodeHighlighter.prototype = {
1823 /** 1823 /**
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1870 { 1870 {
1871 WebInspector.overridesSupport.setTouchEmulationSuspended(enabled); 1871 WebInspector.overridesSupport.setTouchEmulationSuspended(enabled);
1872 this._agent.setInspectModeEnabled(enabled, inspectUAShadowDOM, config, c allback); 1872 this._agent.setInspectModeEnabled(enabled, inspectUAShadowDOM, config, c allback);
1873 } 1873 }
1874 } 1874 }
1875 1875
1876 /** 1876 /**
1877 * @type {!WebInspector.DOMModel} 1877 * @type {!WebInspector.DOMModel}
1878 */ 1878 */
1879 WebInspector.domModel; 1879 WebInspector.domModel;
OLDNEW
« no previous file with comments | « Source/devtools/front_end/sdk/ConsoleModel.js ('k') | Source/devtools/front_end/sdk/DOMStorage.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698