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

Side by Side Diff: chrome/browser/resources/history/other_devices.js

Issue 2163893003: Start sending auxclick instead of click for non-primary buttons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another rebase Created 4 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/resources/md_downloads/crisper.js » ('j') | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 section of the history page that shows tabs from sessions 6 * @fileoverview The section of the history page that shows tabs from sessions
7 on other devices. 7 on other devices.
8 */ 8 */
9 9
10 /////////////////////////////////////////////////////////////////////////////// 10 ///////////////////////////////////////////////////////////////////////////////
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 // We need to use this to not lose the ids as we go through other loop 285 // We need to use this to not lose the ids as we go through other loop
286 // turns. 286 // turns.
287 function makeClickHandler(sessionTag, windowId, tabId) { 287 function makeClickHandler(sessionTag, windowId, tabId) {
288 return function(e) { 288 return function(e) {
289 recordUmaEvent_(HISTOGRAM_EVENT.LINK_CLICKED); 289 recordUmaEvent_(HISTOGRAM_EVENT.LINK_CLICKED);
290 chrome.send('openForeignSession', [sessionTag, windowId, tabId, 290 chrome.send('openForeignSession', [sessionTag, windowId, tabId,
291 e.button, e.altKey, e.ctrlKey, e.metaKey, e.shiftKey]); 291 e.button, e.altKey, e.ctrlKey, e.metaKey, e.shiftKey]);
292 e.preventDefault(); 292 e.preventDefault();
293 }; 293 };
294 }; 294 };
295 a.addEventListener('click', makeClickHandler(sessionTag, 295 ['click', 'auxclick'].forEach(function(eventName) {
296 String(win.sessionId), 296 a.addEventListener(eventName,
297 String(tab.sessionId))); 297 makeClickHandler(sessionTag,
298 String(win.sessionId),
299 String(tab.sessionId)));
300 });
298 var wrapper = createElementWithClassName('div', 'device-tab-wrapper'); 301 var wrapper = createElementWithClassName('div', 'device-tab-wrapper');
299 wrapper.appendChild(a); 302 wrapper.appendChild(a);
300 contents.appendChild(wrapper); 303 contents.appendChild(wrapper);
301 } else { 304 } else {
302 numTabsHidden++; 305 numTabsHidden++;
303 } 306 }
304 } 307 }
305 } 308 }
306 309
307 if (numTabsHidden > 0) { 310 if (numTabsHidden > 0) {
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 devicesView.setSearchText($('search-field').value); 581 devicesView.setSearchText($('search-field').value);
579 }; 582 };
580 $('search-field').addEventListener('search', doSearch); 583 $('search-field').addEventListener('search', doSearch);
581 $('search-button').addEventListener('click', doSearch); 584 $('search-button').addEventListener('click', doSearch);
582 585
583 chrome.send('otherDevicesInitialized'); 586 chrome.send('otherDevicesInitialized');
584 } 587 }
585 588
586 // Add handlers to HTML elements. 589 // Add handlers to HTML elements.
587 document.addEventListener('DOMContentLoaded', load); 590 document.addEventListener('DOMContentLoaded', load);
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/md_downloads/crisper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698