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

Unified Diff: chrome/browser/resources/shared/js/cr/ui/menu_item.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: Don't steal keyboard events that the menu doesn't handle, and detect focusin on unrelated elements … 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
« no previous file with comments | « chrome/browser/resources/shared/js/cr/ui/menu_button.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/shared/js/cr/ui/menu_item.js
diff --git a/chrome/browser/resources/shared/js/cr/ui/menu_item.js b/chrome/browser/resources/shared/js/cr/ui/menu_item.js
index cdd63024701d0249f1a1531d5df487c47b5adc57..67da06531580dad78d92efb759237ee744e95166 100644
--- a/chrome/browser/resources/shared/js/cr/ui/menu_item.js
+++ b/chrome/browser/resources/shared/js/cr/ui/menu_item.js
@@ -40,6 +40,8 @@ cr.define('cr.ui', function() {
// the appearance of this element.
this.classList.add('custom-appearance');
+ this.setAttribute('role', 'menuitem');
+
var iconUrl;
if ((iconUrl = this.getAttribute('icon')))
this.iconUrl = iconUrl;
@@ -183,8 +185,11 @@ cr.define('cr.ui', function() {
// Store |contextElement| since it'll be removed by {Menu} on handling
// 'activate' event.
var contextElement = this.parentNode.contextElement;
+ var activationEvent = cr.doc.createEvent('Event');
+ activationEvent.initEvent('activate', true, true);
+ activationEvent.originalEvent = e;
// Dispatch command event followed by executing the command object.
- if (cr.dispatchSimpleEvent(this, 'activate', true, true)) {
+ if (this.dispatchEvent(activationEvent)) {
var command = this.command;
if (command)
command.execute(contextElement);
« no previous file with comments | « chrome/browser/resources/shared/js/cr/ui/menu_button.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698