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

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

Issue 2609393003: ESC button closes Add Supervised User menu (Closed)
Patch Set: 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..e9579ef1529e7a206ba3c8f954483d40489e49a3 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)
@@ -118,8 +120,10 @@ cr.define('login', function() {
return;
if (active) {
this.getMoreSettingsMenu.classList.add('active');
xiyuan 2017/01/09 21:55:43 nit: maybe change this and line 125 to this.get
Greg Levin 2017/01/09 22:34:40 Done.
+ $('more-settings-button').tabIndex = -1;
xiyuan 2017/01/09 21:55:43 Is changing tabIndex necessary? If the intention
Greg Levin 2017/01/09 22:34:40 The intent is only to remove the [...] button from
xiyuan 2017/01/09 23:17:43 I understand what we are trying to do and agree th
} else {
this.getMoreSettingsMenu.classList.remove('active');
+ $('more-settings-button').tabIndex = 0;
}
},
@@ -147,11 +151,6 @@ cr.define('login', function() {
this.isMoreSettingsActive = false;
},
- handleAddSupervisedUserClick_: function(e) {
- chrome.send('showSupervisedUserCreationScreen');
- e.preventDefault();
- },
-
/**
* Cancel add user button click handler.
*
@@ -211,6 +210,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