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

Side by Side Diff: chrome/browser/resources/ntp4/recently_closed.js

Issue 12754009: Fix recently closed multiple tabs regression. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview The recently closed menu: button, model data, and menu. 6 * @fileoverview The recently closed menu: button, model data, and menu.
7 */ 7 */
8 8
9 cr.define('ntp', function() { 9 cr.define('ntp', function() {
10 'use strict'; 10 'use strict';
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 var index = Array.prototype.indexOf.call(a.parentNode.children, a); 94 var index = Array.prototype.indexOf.call(a.parentNode.children, a);
95 var orig = e.originalEvent; 95 var orig = e.originalEvent;
96 var params = [data.sessionId, 96 var params = [data.sessionId,
97 index, 97 index,
98 orig.type == 'click' ? orig.button : 0, 98 orig.type == 'click' ? orig.button : 0,
99 orig.altKey, 99 orig.altKey,
100 orig.ctrlKey, 100 orig.ctrlKey,
101 orig.metaKey, 101 orig.metaKey,
102 orig.shiftKey]; 102 orig.shiftKey];
103 chrome.send('reopenTab', params); 103 chrome.send('reopenTab', params);
104
105 // We are likely deleted by this point!
106 e.stopPropagation();
107 e.preventDefault();
108 } 104 }
109 a.addEventListener('activate', onActivated); 105 a.addEventListener('activate', onActivated);
106 a.addEventListener('click', function(e) { e.preventDefault(); });
110 107
111 this.menu.appendChild(a); 108 this.menu.appendChild(a);
112 cr.ui.decorate(a, MenuItem); 109 cr.ui.decorate(a, MenuItem);
113 }, 110 },
114 }; 111 };
115 112
116 return { 113 return {
117 RecentMenuButton: RecentMenuButton, 114 RecentMenuButton: RecentMenuButton,
118 }; 115 };
119 }); 116 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698