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

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

Issue 243233002: [DevTools] Disable touch emulation on devices with touch input. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 61 }
62 62
63 /** 63 /**
64 * @return {boolean} 64 * @return {boolean}
65 */ 65 */
66 WebInspector.OverridesSupport.isInspectingDevice = function() 66 WebInspector.OverridesSupport.isInspectingDevice = function()
67 { 67 {
68 return !!WebInspector.queryParam("remoteFrontend"); 68 return !!WebInspector.queryParam("remoteFrontend");
69 } 69 }
70 70
71 /**
72 * @return {boolean}
73 */
74 WebInspector.OverridesSupport.hasTouchInputs = function()
75 {
76 var target = WebInspector.targetManager.mainTarget();
pfeldman 2014/04/18 16:23:15 There is no main target. Please use activeTarget f
77 return !!target && target.hasTouchInputs;
78 }
79
71 WebInspector.OverridesSupport.Events = { 80 WebInspector.OverridesSupport.Events = {
72 OverridesWarningUpdated: "OverridesWarningUpdated", 81 OverridesWarningUpdated: "OverridesWarningUpdated",
73 HasActiveOverridesChanged: "HasActiveOverridesChanged", 82 HasActiveOverridesChanged: "HasActiveOverridesChanged",
74 } 83 }
75 84
76 /** 85 /**
77 * @constructor 86 * @constructor
78 * @param {number} width 87 * @param {number} width
79 * @param {number} height 88 * @param {number} height
80 * @param {number} deviceScaleFactor 89 * @param {number} deviceScaleFactor
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 return; 529 return;
521 } 530 }
522 531
523 var deviceOrientation = WebInspector.OverridesSupport.DeviceOrientation. parseSetting(WebInspector.settings.deviceOrientationOverride.get()); 532 var deviceOrientation = WebInspector.OverridesSupport.DeviceOrientation. parseSetting(WebInspector.settings.deviceOrientationOverride.get());
524 PageAgent.setDeviceOrientationOverride(deviceOrientation.alpha, deviceOr ientation.beta, deviceOrientation.gamma); 533 PageAgent.setDeviceOrientationOverride(deviceOrientation.alpha, deviceOr ientation.beta, deviceOrientation.gamma);
525 this.maybeHasActiveOverridesChanged(); 534 this.maybeHasActiveOverridesChanged();
526 }, 535 },
527 536
528 _emulateTouchEventsChanged: function() 537 _emulateTouchEventsChanged: function()
529 { 538 {
530 if (WebInspector.OverridesSupport.isInspectingDevice() && WebInspector.s ettings.emulateTouchEvents.get()) 539 if (WebInspector.OverridesSupport.hasTouchInputs() && WebInspector.setti ngs.emulateTouchEvents.get())
531 return; 540 return;
532 541
533 var emulateTouch = WebInspector.settings.emulateTouchEvents.get(); 542 var emulateTouch = WebInspector.settings.emulateTouchEvents.get();
534 var targets = WebInspector.targetManager.targets(); 543 var targets = WebInspector.targetManager.targets();
535 for (var i = 0; i < targets.length; ++i) 544 for (var i = 0; i < targets.length; ++i)
536 targets[i].domModel.emulateTouchEventObjects(emulateTouch); 545 targets[i].domModel.emulateTouchEventObjects(emulateTouch);
537 this.maybeHasActiveOverridesChanged(); 546 this.maybeHasActiveOverridesChanged();
538 }, 547 },
539 548
540 _cssMediaChanged: function() 549 _cssMediaChanged: function()
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 }, 607 },
599 608
600 __proto__: WebInspector.Object.prototype 609 __proto__: WebInspector.Object.prototype
601 } 610 }
602 611
603 612
604 /** 613 /**
605 * @type {!WebInspector.OverridesSupport} 614 * @type {!WebInspector.OverridesSupport}
606 */ 615 */
607 WebInspector.overridesSupport; 616 WebInspector.overridesSupport;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698