| 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 1829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1840 if (error) { | 1840 if (error) { |
| 1841 callback(null); | 1841 callback(null); |
| 1842 return; | 1842 return; |
| 1843 } | 1843 } |
| 1844 callback(this.nodeForId(nodeId)); | 1844 callback(this.nodeForId(nodeId)); |
| 1845 } | 1845 } |
| 1846 } | 1846 } |
| 1847 | 1847 |
| 1848 /** | 1848 /** |
| 1849 * @param {!SDK.RemoteObject} object | 1849 * @param {!SDK.RemoteObject} object |
| 1850 * @param {function(?SDK.DOMNode)} callback | 1850 * @return {!Promise<?SDK.DOMNode>} |
| 1851 */ | 1851 */ |
| 1852 pushObjectAsNodeToFrontend(object, callback) { | 1852 pushObjectAsNodeToFrontend(object) { |
| 1853 if (object.isNode()) | 1853 return new Promise(fulfill => { |
| 1854 this.pushNodeToFrontend(/** @type {string} */ (object.objectId), callback)
; | 1854 if (object.isNode()) |
| 1855 else | 1855 this.pushNodeToFrontend(/** @type {string} */ (object.objectId), fulfill
); |
| 1856 callback(null); | 1856 else |
| 1857 fulfill(null); |
| 1858 }); |
| 1857 } | 1859 } |
| 1858 | 1860 |
| 1859 /** | 1861 /** |
| 1860 * @override | 1862 * @override |
| 1861 * @return {!Promise} | 1863 * @return {!Promise} |
| 1862 */ | 1864 */ |
| 1863 suspendModel() { | 1865 suspendModel() { |
| 1864 return new Promise(promiseBody.bind(this)); | 1866 return new Promise(promiseBody.bind(this)); |
| 1865 | 1867 |
| 1866 /** | 1868 /** |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2148 /** | 2150 /** |
| 2149 * @override | 2151 * @override |
| 2150 * @param {!Protocol.Page.FrameId} frameId | 2152 * @param {!Protocol.Page.FrameId} frameId |
| 2151 */ | 2153 */ |
| 2152 highlightFrame(frameId) { | 2154 highlightFrame(frameId) { |
| 2153 this._agent.highlightFrame( | 2155 this._agent.highlightFrame( |
| 2154 frameId, Common.Color.PageHighlight.Content.toProtocolRGBA(), | 2156 frameId, Common.Color.PageHighlight.Content.toProtocolRGBA(), |
| 2155 Common.Color.PageHighlight.ContentOutline.toProtocolRGBA()); | 2157 Common.Color.PageHighlight.ContentOutline.toProtocolRGBA()); |
| 2156 } | 2158 } |
| 2157 }; | 2159 }; |
| OLD | NEW |