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

Unified Diff: chrome/browser/resources/chromeos/login/oobe.js

Issue 2747423005: cros: Allow hotrod remote to check/uncheck a11y checkboxes for CFM oobe (Closed)
Patch Set: simulate click event Created 3 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/login/oobe.js
diff --git a/chrome/browser/resources/chromeos/login/oobe.js b/chrome/browser/resources/chromeos/login/oobe.js
index 6fca7cdc4264f5e6042c5cbe332a0e8c7d10e5e8..66668be334562cb7ad32621f379fa47f4c9ec5b1 100644
--- a/chrome/browser/resources/chromeos/login/oobe.js
+++ b/chrome/browser/resources/chromeos/login/oobe.js
@@ -175,7 +175,16 @@ cr.define('cr.ui.Oobe', function() {
$('screen-magnifier').addEventListener('click',
Oobe.handleScreenMagnifierClick);
$('virtual-keyboard').addEventListener('click',
- Oobe.handleVirtualKeyboardClick);
+ Oobe.handleVirtualKeyboardClick);
+
+ $('high-contrast').addEventListener('keypress', Oobe.handleA11yKeyPress);
+ $('large-cursor').addEventListener('keypress', Oobe.handleA11yKeyPress);
+ $('spoken-feedback')
+ .addEventListener('keypress', Oobe.handleA11yKeyPress);
+ $('screen-magnifier')
+ .addEventListener('keypress', Oobe.handleA11yKeyPress);
+ $('virtual-keyboard')
+ .addEventListener('keypress', Oobe.handleA11yKeyPress);
// A11y menu should be accessible i.e. disable autohide on any
// keydown or click inside menu.
@@ -220,6 +229,20 @@ cr.define('cr.ui.Oobe', function() {
},
/**
+ * handle a11y menu checkboxes keypress event by simulating click event.
+ */
+ handleA11yKeyPress: function(e) {
+ if (e.key != 'Enter')
+ return;
+
+ if (e.target.tagName != 'INPUT' || e.target.type != 'checkbox')
+ return;
+
+ // Simulate click on the checkbox.
+ e.target.click()
+ },
+
+ /**
* Spoken feedback checkbox handler.
*/
handleSpokenFeedbackClick: function(e) {
« 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