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

Unified Diff: chrome/browser/resources/ntp4/recently_closed.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/ntp4/recently_closed.js
diff --git a/chrome/browser/resources/ntp4/recently_closed.js b/chrome/browser/resources/ntp4/recently_closed.js
index a50306dbb6cc79647d4990040e92d69f45d25b42..8399ca12dad06b260a159baa50a002311f7a9daa 100644
--- a/chrome/browser/resources/ntp4/recently_closed.js
+++ b/chrome/browser/resources/ntp4/recently_closed.js
@@ -90,19 +90,27 @@ cr.define('ntp', function() {
a.textContent = data.title;
}
- function onClick(e) {
+ function onActivated(e) {
ntp.logTimeToClick('RecentlyClosed');
chrome.send('recordAppLaunchByURL',
[encodeURIComponent(data.url),
ntp.APP_LAUNCH.NTP_RECENTLY_CLOSED]);
var index = Array.prototype.indexOf.call(a.parentNode.children, a);
- chrome.send('reopenTab', [data.sessionId, index,
- e.button, e.altKey, e.ctrlKey, e.metaKey, e.shiftKey]);
- // We are likely deleted by this point!
+ var orig = e.originalEvent;
+ var params = [data.sessionId,
+ index,
+ orig.type == 'click' ? orig.button : 0,
+ orig.altKey,
+ orig.ctrlKey,
+ orig.metaKey,
+ orig.shiftKey];
+ chrome.send('reopenTab', params);
+ // We are likely deleted by this point!
+ e.stopPropagation();
Dan Beam 2013/03/14 21:22:01 aboxhall@: ^ why did you add this?
e.preventDefault();
}
- a.addEventListener('click', onClick);
+ a.addEventListener('activate', onActivated);
this.menu.appendChild(a);
cr.ui.decorate(a, MenuItem);

Powered by Google App Engine
This is Rietveld 408576698