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

Unified Diff: chrome/browser/resources/settings/device_page/display.js

Issue 2620073002: Adds the touch calibration setting behind a chrome switch (Closed)
Patch Set: nits Created 3 years, 11 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: chrome/browser/resources/settings/device_page/display.js
diff --git a/chrome/browser/resources/settings/device_page/display.js b/chrome/browser/resources/settings/device_page/display.js
index 549dfa19fea3fbbbb4ba79f780df89d549eaec53..3f5cfffc1fccad9a660ffe564bdcee9782f71076 100644
--- a/chrome/browser/resources/settings/device_page/display.js
+++ b/chrome/browser/resources/settings/device_page/display.js
@@ -166,6 +166,20 @@ Polymer({
},
/**
+ * Returns true if the given display has touch support and is not an internal
+ * display. If the feature is not enabled via the switch, this will return
+ * false.
+ * @param {!chrome.system.display.DisplayUnitInfo} display Display being
+ * checked for touch support.
+ * @return {boolean}
+ * @private
+ */
+ showTouchCalibrationSetting_: function(display) {
+ return !display.isInternal && display.hasTouchSupport &&
+ loadTimeData.getBoolean('enableTouchCalibrationSetting');
+ },
+
+ /**
* @param {!Array<!chrome.system.display.DisplayUnitInfo>} displays
* @return {boolean}
* @private
@@ -296,6 +310,16 @@ Polymer({
},
/**
+ * Handles event when a touch calibration option is selected.
+ * @param {!Event} e
+ * @private
+ */
+ onTouchCalibrationTap_: function(e) {
+ settings.display.systemDisplayApi.touchCalibrationStart(
+ this.selectedDisplay.id);
+ },
+
+ /**
* Handles the event when an option from display select menu is selected.
* @param {!{target: !HTMLSelectElement}} e
* @private

Powered by Google App Engine
This is Rietveld 408576698