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

Unified Diff: third_party/WebKit/Source/devtools/front_end/emulation/SensorsView.js

Issue 1739533005: [DevTools] Add touch to sensors view. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/emulation/SensorsView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/SensorsView.js b/third_party/WebKit/Source/devtools/front_end/emulation/SensorsView.js
index fb3073932567b9f97c56ced9e37a96cde146b45b..d9cf4d773f0147923dc28d809e36ca13db4546c8 100644
--- a/third_party/WebKit/Source/devtools/front_end/emulation/SensorsView.js
+++ b/third_party/WebKit/Source/devtools/front_end/emulation/SensorsView.js
@@ -21,6 +21,8 @@ WebInspector.SensorsView = function()
this._deviceOrientation = WebInspector.DeviceOrientation.parseSetting(this._deviceOrientationSetting.get());
this._deviceOrientationEnabled = false;
this._appendDeviceOrientationOverrideControl();
+
+ this._appendTouchControl();
}
WebInspector.SensorsView.prototype = {
@@ -297,6 +299,21 @@ WebInspector.SensorsView.prototype = {
return new WebInspector.Geometry.Vector(sphereX, sphereY, Math.sqrt(1 - sqrSum));
},
+ _appendTouchControl: function()
+ {
+ var label = this.contentElement.createChild("label", "touch-label");
+ label.createChild("span", "").textContent = WebInspector.UIString("Touch");
+ var select = label.createChild("select", "chrome-select");
+ select.appendChild(new Option(WebInspector.UIString("Device-based"), "auto"));
+ select.appendChild(new Option(WebInspector.UIString("Force enabled"), "enabled"));
+ select.addEventListener("change", applyTouch, false);
+
+ function applyTouch()
+ {
+ WebInspector.MultitargetTouchModel.instance().setCustomTouchEnabled(select.value === "enabled");
+ }
+ },
+
__proto__ : WebInspector.VBox.prototype
}

Powered by Google App Engine
This is Rietveld 408576698