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

Unified Diff: chrome/browser/resources/shared/js/cr/ui/menu_button.js

Issue 10966027: Basic keyboard access for recently_closed menu on NTP. Allows using up and down arrows to navigate,… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add menu/menuitem role, comment for Tab character, and keep track of last selected item. Created 8 years, 3 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
Index: chrome/browser/resources/shared/js/cr/ui/menu_button.js
diff --git a/chrome/browser/resources/shared/js/cr/ui/menu_button.js b/chrome/browser/resources/shared/js/cr/ui/menu_button.js
index 3363babb65b5bd3f2ffa490243c1da3f9aed5566..ff81258728967d5a72272819189e15d5a334e16e 100644
--- a/chrome/browser/resources/shared/js/cr/ui/menu_button.js
+++ b/chrome/browser/resources/shared/js/cr/ui/menu_button.js
@@ -100,7 +100,6 @@ cr.define('cr.ui', function() {
break;
case 'activate':
- case 'blur':
dmazzoni 2012/09/24 17:49:06 Just checking, do we want to handle 'blur' still b
aboxhall 2012/09/24 22:39:38 This makes sense, but as I describe below, it actu
case 'resize':
this.hideMenu();
break;
@@ -120,6 +119,7 @@ cr.define('cr.ui', function() {
this.menu.hidden = false;
this.setAttribute('menu-shown', '');
+ this.menu.focusSelectedItem();
// when the menu is shown we steal all keyboard events.
var doc = this.ownerDocument;
@@ -145,7 +145,7 @@ cr.define('cr.ui', function() {
this.menu.hidden = true;
this.showingEvents_.removeAll();
- this.menu.selectedIndex = -1;
+ this.focus();
},
/**
@@ -180,6 +180,7 @@ cr.define('cr.ui', function() {
break;
case 'Esc':
case 'U+001B': // Maybe this is remote desktop playing a prank?
+ case 'U+0009': // Tab
dmazzoni 2012/09/24 17:49:06 Specifically trapping the tab key worries me a bit
aboxhall 2012/09/24 22:39:38 So, I did have the same thought while I was workin
dmazzoni 2012/09/24 22:48:56 OK. If it isn't needed, that's fine. I'm still cur
aboxhall 2012/09/25 04:31:30 Ok, it's triggered by a mouse event at line 78 of
this.hideMenu();
break;
}
« no previous file with comments | « chrome/browser/resources/shared/js/cr/ui/menu.js ('k') | chrome/browser/resources/shared/js/cr/ui/menu_item.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698