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 1574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1585 this.markUndoableState(); | 1585 this.markUndoableState(); |
1586 | 1586 |
1587 if (callback) | 1587 if (callback) |
1588 callback.apply(this, arguments); | 1588 callback.apply(this, arguments); |
1589 } | 1589 } |
1590 return wrapperFunction.bind(this); | 1590 return wrapperFunction.bind(this); |
1591 }, | 1591 }, |
1592 | 1592 |
1593 /** | 1593 /** |
1594 * @param {boolean} emulationEnabled | 1594 * @param {boolean} emulationEnabled |
| 1595 * @param {string} configuration |
1595 */ | 1596 */ |
1596 emulateTouchEventObjects: function(emulationEnabled) | 1597 emulateTouchEventObjects: function(emulationEnabled, configuration) |
1597 { | 1598 { |
1598 /** | 1599 /** |
1599 * @suppressGlobalPropertiesCheck | 1600 * @suppressGlobalPropertiesCheck |
1600 */ | 1601 */ |
1601 const injectedFunction = function() { | 1602 const injectedFunction = function() { |
1602 const touchEvents = ["ontouchstart", "ontouchend", "ontouchmove", "o
ntouchcancel"]; | 1603 const touchEvents = ["ontouchstart", "ontouchend", "ontouchmove", "o
ntouchcancel"]; |
1603 var recepients = [window.__proto__, document.__proto__]; | 1604 var recepients = [window.__proto__, document.__proto__]; |
1604 for (var i = 0; i < touchEvents.length; ++i) { | 1605 for (var i = 0; i < touchEvents.length; ++i) { |
1605 for (var j = 0; j < recepients.length; ++j) { | 1606 for (var j = 0; j < recepients.length; ++j) { |
1606 if (!(touchEvents[i] in recepients[j])) | 1607 if (!(touchEvents[i] in recepients[j])) |
(...skipping 18 matching lines...) Expand all Loading... |
1625 * @this {WebInspector.DOMModel} | 1626 * @this {WebInspector.DOMModel} |
1626 */ | 1627 */ |
1627 function scriptAddedCallback(error, scriptId) | 1628 function scriptAddedCallback(error, scriptId) |
1628 { | 1629 { |
1629 delete this._addTouchEventsScriptInjecting; | 1630 delete this._addTouchEventsScriptInjecting; |
1630 if (error) | 1631 if (error) |
1631 return; | 1632 return; |
1632 this._addTouchEventsScriptId = scriptId; | 1633 this._addTouchEventsScriptId = scriptId; |
1633 } | 1634 } |
1634 | 1635 |
1635 PageAgent.setTouchEmulationEnabled(emulationEnabled); | 1636 PageAgent.setTouchEmulationEnabled(emulationEnabled, configuration); |
1636 }, | 1637 }, |
1637 | 1638 |
1638 markUndoableState: function() | 1639 markUndoableState: function() |
1639 { | 1640 { |
1640 this._agent.markUndoableState(); | 1641 this._agent.markUndoableState(); |
1641 }, | 1642 }, |
1642 | 1643 |
1643 /** | 1644 /** |
1644 * @param {function(?Protocol.Error)=} callback | 1645 * @param {function(?Protocol.Error)=} callback |
1645 */ | 1646 */ |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1961 * @param {boolean} inspectUAShadowDOM | 1962 * @param {boolean} inspectUAShadowDOM |
1962 * @param {!DOMAgent.HighlightConfig} config | 1963 * @param {!DOMAgent.HighlightConfig} config |
1963 * @param {function(?Protocol.Error)=} callback | 1964 * @param {function(?Protocol.Error)=} callback |
1964 */ | 1965 */ |
1965 setInspectModeEnabled: function(enabled, inspectUAShadowDOM, config, callbac
k) | 1966 setInspectModeEnabled: function(enabled, inspectUAShadowDOM, config, callbac
k) |
1966 { | 1967 { |
1967 WebInspector.overridesSupport.setTouchEmulationSuspended(enabled); | 1968 WebInspector.overridesSupport.setTouchEmulationSuspended(enabled); |
1968 this._agent.setInspectModeEnabled(enabled, inspectUAShadowDOM, config, c
allback); | 1969 this._agent.setInspectModeEnabled(enabled, inspectUAShadowDOM, config, c
allback); |
1969 } | 1970 } |
1970 } | 1971 } |
OLD | NEW |