OLD | NEW |
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 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1363 | 1363 |
1364 /** | 1364 /** |
1365 * @param {?Protocol.DOM.Node} payload | 1365 * @param {?Protocol.DOM.Node} payload |
1366 */ | 1366 */ |
1367 _setDocument(payload) { | 1367 _setDocument(payload) { |
1368 this._idToDOMNode = {}; | 1368 this._idToDOMNode = {}; |
1369 if (payload && 'nodeId' in payload) | 1369 if (payload && 'nodeId' in payload) |
1370 this._document = new SDK.DOMDocument(this, payload); | 1370 this._document = new SDK.DOMDocument(this, payload); |
1371 else | 1371 else |
1372 this._document = null; | 1372 this._document = null; |
1373 this.dispatchEventToListeners(SDK.DOMModel.Events.DocumentUpdated, this._doc
ument); | 1373 this.dispatchEventToListeners(SDK.DOMModel.Events.DocumentUpdated, this); |
1374 } | 1374 } |
1375 | 1375 |
1376 /** | 1376 /** |
1377 * @param {!Protocol.DOM.Node} payload | 1377 * @param {!Protocol.DOM.Node} payload |
1378 */ | 1378 */ |
1379 _setDetachedRoot(payload) { | 1379 _setDetachedRoot(payload) { |
1380 if (payload.nodeName === '#document') | 1380 if (payload.nodeName === '#document') |
1381 new SDK.DOMDocument(this, payload); | 1381 new SDK.DOMDocument(this, payload); |
1382 else | 1382 else |
1383 SDK.DOMNode.create(this, null, false, payload); | 1383 SDK.DOMNode.create(this, null, false, payload); |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1721 /** | 1721 /** |
1722 * @param {!Protocol.DOM.InspectMode} mode | 1722 * @param {!Protocol.DOM.InspectMode} mode |
1723 * @param {function(?Protocol.Error)=} callback | 1723 * @param {function(?Protocol.Error)=} callback |
1724 */ | 1724 */ |
1725 setInspectMode(mode, callback) { | 1725 setInspectMode(mode, callback) { |
1726 /** | 1726 /** |
1727 * @this {SDK.DOMModel} | 1727 * @this {SDK.DOMModel} |
1728 */ | 1728 */ |
1729 function onDocumentAvailable() { | 1729 function onDocumentAvailable() { |
1730 this._inspectModeEnabled = mode !== Protocol.DOM.InspectMode.None; | 1730 this._inspectModeEnabled = mode !== Protocol.DOM.InspectMode.None; |
1731 this.dispatchEventToListeners(SDK.DOMModel.Events.InspectModeWillBeToggled
, this._inspectModeEnabled); | 1731 this.dispatchEventToListeners(SDK.DOMModel.Events.InspectModeWillBeToggled
, this); |
1732 this._highlighter.setInspectMode(mode, this._buildHighlightConfig(), callb
ack); | 1732 this._highlighter.setInspectMode(mode, this._buildHighlightConfig(), callb
ack); |
1733 } | 1733 } |
1734 this.requestDocument(onDocumentAvailable.bind(this)); | 1734 this.requestDocument(onDocumentAvailable.bind(this)); |
1735 } | 1735 } |
1736 | 1736 |
1737 /** | 1737 /** |
1738 * @return {boolean} | 1738 * @return {boolean} |
1739 */ | 1739 */ |
1740 inspectModeEnabled() { | 1740 inspectModeEnabled() { |
1741 return this._inspectModeEnabled; | 1741 return this._inspectModeEnabled; |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2162 /** | 2162 /** |
2163 * @override | 2163 * @override |
2164 * @param {!Protocol.Page.FrameId} frameId | 2164 * @param {!Protocol.Page.FrameId} frameId |
2165 */ | 2165 */ |
2166 highlightFrame(frameId) { | 2166 highlightFrame(frameId) { |
2167 this._agent.highlightFrame( | 2167 this._agent.highlightFrame( |
2168 frameId, Common.Color.PageHighlight.Content.toProtocolRGBA(), | 2168 frameId, Common.Color.PageHighlight.Content.toProtocolRGBA(), |
2169 Common.Color.PageHighlight.ContentOutline.toProtocolRGBA()); | 2169 Common.Color.PageHighlight.ContentOutline.toProtocolRGBA()); |
2170 } | 2170 } |
2171 }; | 2171 }; |
OLD | NEW |