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

Side by Side Diff: Source/devtools/front_end/emulation/OverridesSupport.js

Issue 1313793005: Fixes a bug where touch device scripts were not cleared on exit of device mode in devtools. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 for (var j = 0; j < recepients.length; ++j) { 703 for (var j = 0; j < recepients.length; ++j) {
704 if (!(touchEvents[i] in recepients[j])) 704 if (!(touchEvents[i] in recepients[j]))
705 Object.defineProperty(recepients[j], touchEvents[i], { v alue: null, writable: true, configurable: true, enumerable: true }); 705 Object.defineProperty(recepients[j], touchEvents[i], { v alue: null, writable: true, configurable: true, enumerable: true });
706 } 706 }
707 } 707 }
708 } 708 }
709 709
710 var symbol = WebInspector.OverridesSupport._touchEventsScriptIdSymbol; 710 var symbol = WebInspector.OverridesSupport._touchEventsScriptIdSymbol;
711 711
712 if (emulationEnabled && target[symbol] !== -1) { 712 if (emulationEnabled && target[symbol] !== -1) {
713 if (typeof target[symbol] !== "undefined")
714 target.pageAgent().removeScriptToEvaluateOnLoad(target[symbol]);
dgozman 2015/08/25 18:02:09 This is getting messy. Could you please rewrite th
715
713 target[symbol] = -1; 716 target[symbol] = -1;
714 target.pageAgent().addScriptToEvaluateOnLoad("(" + injectedFunction. toString() + ")()", scriptAddedCallback); 717 target.pageAgent().addScriptToEvaluateOnLoad("(" + injectedFunction. toString() + ")()", scriptAddedCallback);
715 } else { 718 } else {
716 if (typeof target[symbol] !== "undefined") { 719 if (typeof target[symbol] !== "undefined") {
717 target.pageAgent().removeScriptToEvaluateOnLoad(target[symbol]); 720 target.pageAgent().removeScriptToEvaluateOnLoad(target[symbol]);
718 delete target[symbol]; 721 delete target[symbol];
719 } 722 }
720 } 723 }
721 724
722 /** 725 /**
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 }, 821 },
819 822
820 __proto__: WebInspector.Object.prototype 823 __proto__: WebInspector.Object.prototype
821 } 824 }
822 825
823 826
824 /** 827 /**
825 * @type {!WebInspector.OverridesSupport} 828 * @type {!WebInspector.OverridesSupport}
826 */ 829 */
827 WebInspector.overridesSupport; 830 WebInspector.overridesSupport;
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698