Chromium Code Reviews| 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); |