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

Unified Diff: chrome/browser/resources/ntp4/recently_closed.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: Get rid of pointless experimental code" 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/ntp4/recently_closed.js
diff --git a/chrome/browser/resources/ntp4/recently_closed.js b/chrome/browser/resources/ntp4/recently_closed.js
index a50306dbb6cc79647d4990040e92d69f45d25b42..96506cb13d47ebfd440029c60538aadcb743d9ec 100644
--- a/chrome/browser/resources/ntp4/recently_closed.js
+++ b/chrome/browser/resources/ntp4/recently_closed.js
@@ -90,19 +90,26 @@ 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]);
+ var orig = e.originalEvent;
Dan Beam 2012/09/21 03:44:50 nit: IMO var params = [data.sessionId,
aboxhall 2012/09/21 06:46:00 Done.
aboxhall 2012/09/21 06:46:00 Done.
+ if (orig.type == 'click') {
+ chrome.send('reopenTab', [data.sessionId, index,
+ orig.button, orig.altKey, orig.ctrlKey, orig.metaKey,
+ orig.shiftKey]);
+ } else {
+ chrome.send('reopenTab', [data.sessionId, index,
+ 0, orig.altKey, orig.ctrlKey, orig.metaKey, orig.shiftKey]);
+ }
// We are likely deleted by this point!
-
+ e.stopPropagation();
e.preventDefault();
}
- a.addEventListener('click', onClick);
+ a.addEventListener('activate', onActivated);
Dan Beam 2012/09/21 03:44:50 I really wish this was [cr:ui:]menu:activate or so
aboxhall 2012/09/21 06:46:00 Should I try to fix that in this CL?
Dan Beam 2012/09/21 10:23:48 Any CL ever would surpass the current plans :P
aboxhall 2012/09/24 00:48:52 I found 45 occurrences of 'activate' under chrome/
this.menu.appendChild(a);
cr.ui.decorate(a, MenuItem);

Powered by Google App Engine
This is Rietveld 408576698