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

Unified Diff: chrome/browser/resources/ntp4/recently_closed.js

Issue 8662051: retry r112077 - recently closed menu: respect middle click (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
« no previous file with comments | « chrome/browser/resources/ntp4/apps_page.js ('k') | chrome/browser/sessions/session_restore_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 95c61268e56d794d6d87adefe41f137007e1d7b2..aaba0a6adfdaf739efd5f946862cfe990f13f603 100644
--- a/chrome/browser/resources/ntp4/recently_closed.js
+++ b/chrome/browser/resources/ntp4/recently_closed.js
@@ -89,20 +89,20 @@ cr.define('ntp4', function() {
a.href = data.url;
a.style.backgroundImage = 'url(chrome://favicon/' + data.url + ')';
a.textContent = data.title;
- // TODO(estade): add app ping url.
}
- function onActivate(e) {
+ function onClick(e) {
chrome.send('recordAppLaunchByURL',
[encodeURIComponent(data.url),
ntp4.APP_LAUNCH.NTP_RECENTLY_CLOSED]);
- // TODO(estade): don't convert to string.
- chrome.send('reopenTab', [String(data.sessionId)]);
+ 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!
e.preventDefault();
}
- a.addEventListener('activate', onActivate);
+ a.addEventListener('click', onClick);
this.menu.appendChild(a);
cr.ui.decorate(a, MenuItem);
« no previous file with comments | « chrome/browser/resources/ntp4/apps_page.js ('k') | chrome/browser/sessions/session_restore_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698