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

Unified Diff: chrome/browser/resources/chromeos/keyboard/keyboard_utils.js

Issue 2586113002: MD Settings: ignore modified key events in the profile avatar grid (Closed)
Patch Set: closure Created 4 years 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 | chrome/browser/resources/inspect/inspect.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/keyboard/keyboard_utils.js
diff --git a/chrome/browser/resources/chromeos/keyboard/keyboard_utils.js b/chrome/browser/resources/chromeos/keyboard/keyboard_utils.js
index 8b7960f7da018040419c1e529a15f2ce7f659161..3b289606ce5c85221034d5113c96489d27268023 100644
--- a/chrome/browser/resources/chromeos/keyboard/keyboard_utils.js
+++ b/chrome/browser/resources/chromeos/keyboard/keyboard_utils.js
@@ -46,13 +46,13 @@ keyboard.onAdvanceFocus = function(reverse) {
/**
* Swallows keypress and keyup events of arrow keys.
- * @param {Event} event Raised event.
+ * @param {!Event} event Raised event.
* @private
*/
keyboard.onKeyIgnore_ = function(event) {
- event = /** @type {KeyboardEvent} */(event);
+ event = /** @type {!KeyboardEvent} */(event);
- if (event.ctrlKey || event.shiftKey || event.altKey || event.metaKey)
+ if (hasKeyModifiers(event))
return;
if (event.key == 'ArrowLeft' ||
@@ -66,13 +66,13 @@ keyboard.onKeyIgnore_ = function(event) {
/**
* Handles arrow key events, depending on if self is a content script.
- * @param {Event} event Raised event.
+ * @param {!Event} event Raised event.
* @private
*/
keyboard.onKeyDown_ = function(event) {
- event = /** @type {KeyboardEvent} */(event);
+ event = /** @type {!KeyboardEvent} */(event);
- if (event.ctrlKey || event.shiftKey || event.altKey || event.metaKey)
+ if (hasKeyModifiers(event))
return;
// This file also gets embedded inside of the CfM/hotrod enrollment webview.
« no previous file with comments | « no previous file | chrome/browser/resources/inspect/inspect.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698