| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 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 | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. 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 1981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1992 return InjectedScriptHost.inspectedObject(num); | 1992 return InjectedScriptHost.inspectedObject(num); |
| 1993 }, | 1993 }, |
| 1994 | 1994 |
| 1995 /** | 1995 /** |
| 1996 * @param {!Array.<string>|string=} types | 1996 * @param {!Array.<string>|string=} types |
| 1997 * @return {!Array.<string>} | 1997 * @return {!Array.<string>} |
| 1998 */ | 1998 */ |
| 1999 _normalizeEventTypes: function(types) | 1999 _normalizeEventTypes: function(types) |
| 2000 { | 2000 { |
| 2001 if (typeof types === "undefined") | 2001 if (typeof types === "undefined") |
| 2002 types = ["mouse", "key", "touch", "control", "load", "unload", "abor
t", "error", "select", "input", "change", "submit", "reset", "focus", "blur", "r
esize", "scroll", "search", "devicemotion", "deviceorientation"]; | 2002 types = ["mouse", "key", "touch", "pointer", "control", "load", "unl
oad", "abort", "error", "select", "input", "change", "submit", "reset", "focus",
"blur", "resize", "scroll", "search", "devicemotion", "deviceorientation"]; |
| 2003 else if (typeof types === "string") | 2003 else if (typeof types === "string") |
| 2004 types = [types]; | 2004 types = [types]; |
| 2005 | 2005 |
| 2006 var result = []; | 2006 var result = []; |
| 2007 for (var i = 0; i < types.length; ++i) { | 2007 for (var i = 0; i < types.length; ++i) { |
| 2008 if (types[i] === "mouse") | 2008 if (types[i] === "mouse") |
| 2009 push(result, "click", "dblclick", "mousedown", "mouseeenter", "m
ouseleave", "mousemove", "mouseout", "mouseover", "mouseup", "mouseleave", "mous
ewheel"); | 2009 push(result, "click", "dblclick", "mousedown", "mouseeenter", "m
ouseleave", "mousemove", "mouseout", "mouseover", "mouseup", "mouseleave", "mous
ewheel"); |
| 2010 else if (types[i] === "key") | 2010 else if (types[i] === "key") |
| 2011 push(result, "keydown", "keyup", "keypress", "textInput"); | 2011 push(result, "keydown", "keyup", "keypress", "textInput"); |
| 2012 else if (types[i] === "touch") | 2012 else if (types[i] === "touch") |
| 2013 push(result, "touchstart", "touchmove", "touchend", "touchcancel
"); | 2013 push(result, "touchstart", "touchmove", "touchend", "touchcancel
"); |
| 2014 else if (types[i] === "pointer") |
| 2015 push(result, "pointerover", "pointerout", "pointerenter", "point
erleave", "pointerdown", "pointerup", "pointermove", "pointercancel", "gotpointe
rcapture", "lostpointercapture"); |
| 2014 else if (types[i] === "control") | 2016 else if (types[i] === "control") |
| 2015 push(result, "resize", "scroll", "zoom", "focus", "blur", "selec
t", "input", "change", "submit", "reset"); | 2017 push(result, "resize", "scroll", "zoom", "focus", "blur", "selec
t", "input", "change", "submit", "reset"); |
| 2016 else | 2018 else |
| 2017 push(result, types[i]); | 2019 push(result, types[i]); |
| 2018 } | 2020 } |
| 2019 return result; | 2021 return result; |
| 2020 }, | 2022 }, |
| 2021 | 2023 |
| 2022 /** | 2024 /** |
| 2023 * @param {!Event} event | 2025 * @param {!Event} event |
| 2024 */ | 2026 */ |
| 2025 _logEvent: function(event) | 2027 _logEvent: function(event) |
| 2026 { | 2028 { |
| 2027 inspectedWindow.console.log(event.type, event); | 2029 inspectedWindow.console.log(event.type, event); |
| 2028 } | 2030 } |
| 2029 } | 2031 } |
| 2030 | 2032 |
| 2031 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); | 2033 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); |
| 2032 return injectedScript; | 2034 return injectedScript; |
| 2033 }) | 2035 }) |
| OLD | NEW |