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

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

Issue 11013021: Basic keyboard access for recently_closed menu on NTP (re-work). (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase to current version. Created 8 years, 1 month 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_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 4638ddf91fc93b9566970e5078e4a5edd1f60b20..14bb04afae39c737be32e9f106f2ce499632dd1d 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);

Powered by Google App Engine
This is Rietveld 408576698