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

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

Issue 2609393003: ESC button closes Add Supervised User menu (Closed)
Patch Set: Simplify if/else block, as per review 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
« 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/header_bar.js
diff --git a/chrome/browser/resources/chromeos/login/header_bar.js b/chrome/browser/resources/chromeos/login/header_bar.js
index 524e5ac4b89f868f49efd850601363c5fd688ddb..d5217437f243443c30de92b52f8e92d288a9d895 100644
--- a/chrome/browser/resources/chromeos/login/header_bar.js
+++ b/chrome/browser/resources/chromeos/login/header_bar.js
@@ -64,6 +64,8 @@ cr.define('login', function() {
this.handleCancelMultipleSignInClick_);
this.addSupervisedUserMenu.addEventListener('click',
this.handleAddSupervisedUserClick_.bind(this));
+ this.addSupervisedUserMenu.addEventListener('keydown',
+ this.handleAddSupervisedUserKeyDown_.bind(this));
if (Oobe.getInstance().displayType == DISPLAY_TYPE.LOGIN ||
Oobe.getInstance().displayType == DISPLAY_TYPE.OOBE) {
if (Oobe.getInstance().newKioskUI)
@@ -116,14 +118,10 @@ cr.define('login', function() {
set isMoreSettingsActive(active) {
if (active == this.isMoreSettingsActive)
return;
- if (active) {
- this.getMoreSettingsMenu.classList.add('active');
- } else {
- this.getMoreSettingsMenu.classList.remove('active');
- }
+ this.getMoreSettingsMenu.classList.toggle('active', active);
+ $('more-settings-button').tabIndex = active ? -1 : 0;
},
-
/**
* Add user button click handler.
*
@@ -147,11 +145,6 @@ cr.define('login', function() {
this.isMoreSettingsActive = false;
},
- handleAddSupervisedUserClick_: function(e) {
- chrome.send('showSupervisedUserCreationScreen');
- e.preventDefault();
- },
-
/**
* Cancel add user button click handler.
*
@@ -211,6 +204,28 @@ cr.define('login', function() {
},
/**
+ * Add supervised user button handler.
+ *
+ * @private
+ */
+ handleAddSupervisedUserClick_: function(e) {
+ chrome.send('showSupervisedUserCreationScreen');
+ e.preventDefault();
+ },
+
+ /**
+ * Add supervised user key handler, ESC closes menu.
+ *
+ * @private
+ */
+ handleAddSupervisedUserKeyDown_: function(e) {
+ if (e.key == 'Escape' && this.isMoreSettingsActive) {
+ this.isMoreSettingsActive = false;
+ $('more-settings-button').focus();
+ }
+ },
+
+ /**
* If true then "Browse as Guest" button is shown.
*
* @type {boolean}
« 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