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

Unified Diff: chrome/browser/resources/chromeos/emulator/input_device_settings.js

Issue 2006083002: Use fake Input Device Settings with chrome://device-emulator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DevicePageTestsFixes
Patch Set: make dependent on a11y fix Created 4 years, 5 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/chromeos/emulator/input_device_settings.js
diff --git a/chrome/browser/resources/chromeos/emulator/input_device_settings.js b/chrome/browser/resources/chromeos/emulator/input_device_settings.js
new file mode 100644
index 0000000000000000000000000000000000000000..a297c9fba8a33d2c84e8ddabb232c027f10f4c02
--- /dev/null
+++ b/chrome/browser/resources/chromeos/emulator/input_device_settings.js
@@ -0,0 +1,43 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+Polymer({
+ is: 'input-device-settings',
+
+ behaviors: [Polymer.NeonAnimatableBehavior],
+
+ /**
+ * @param {!Event} e
+ * Callback when the user toggles the touchpad.
+ */
+ onTouchpadChange: function(e) {
+ chrome.send('setHasTouchpad', [e.target.checked]);
+ this.$.changeDescription.opened = true;
+ },
+
+ /**
+ * @param {!Event} e
+ * Callback when the user toggles the mouse.
+ */
+ onMouseChange: function(e) {
+ chrome.send('setHasMouse', [e.target.checked]);
+ this.$.changeDescription.opened = true;
+ },
+
+ /**
+ * Callback when the existence of a fake mouse changes.
+ * @param {boolean} exists
+ */
+ setMouseExists: function(exists) {
+ this.$.mouse.checked = exists;
+ },
+
+ /**
+ * Callback when the existence of a fake touchpad changes.
+ * @param {boolean} exists
+ */
+ setTouchpadExists: function(exists) {
+ this.$.touchpad.checked = exists;
+ },
+});

Powered by Google App Engine
This is Rietveld 408576698