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

Unified Diff: ui/login/bubble.js

Issue 2104103002: Convert Event#keyIdentifier (deprecated) to Event#key (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch file manager test 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
« no previous file with comments | « ui/login/account_picker/user_pod_row.js ('k') | ui/webui/resources/js/action_link.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/login/bubble.js
diff --git a/ui/login/bubble.js b/ui/login/bubble.js
index e31125a453b69a632b14dea1d18b81544131cc12..945cd4e1137f6494ec59532e7e3f82d1bb790b72 100644
--- a/ui/login/bubble.js
+++ b/ui/login/bubble.js
@@ -19,11 +19,11 @@ cr.define('cr.ui', function() {
* Bubble key codes.
* @enum {number}
*/
- var KeyCodes = {
- TAB: 'U+0009',
+ var Keys = {
+ TAB: 'Tab',
ENTER: 'Enter',
- ESC: 'U+001B',
- SPACE: 'U+0020'
+ ESC: 'Escape',
+ SPACE: ' '
};
/**
@@ -327,20 +327,20 @@ cr.define('cr.ui', function() {
}
// Artificial tab-cycle.
- if (e.keyIdentifier == KeyCodes.TAB && e.shiftKey == true &&
+ if (e.key == Keys.TAB && e.shiftKey == true &&
e.target == this.firstBubbleElement_) {
this.lastBubbleElement_.focus();
e.preventDefault();
}
- if (e.keyIdentifier == KeyCodes.TAB && e.shiftKey == false &&
+ if (e.key == Keys.TAB && e.shiftKey == false &&
e.target == this.lastBubbleElement_) {
this.firstBubbleElement_.focus();
e.preventDefault();
}
// Close bubble on ESC or on hitting spacebar or Enter at close-button.
- if (e.keyIdentifier == KeyCodes.ESC ||
- ((e.keyIdentifier == KeyCodes.ENTER ||
- e.keyIdentifier == KeyCodes.SPACE) &&
+ if (e.key == Keys.ESC ||
+ ((e.key == Keys.ENTER ||
+ e.key == Keys.SPACE) &&
e.target && e.target.classList.contains('close-button')))
this.hide();
},
« no previous file with comments | « ui/login/account_picker/user_pod_row.js ('k') | ui/webui/resources/js/action_link.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698