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

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

Issue 2337513002: Only handle click actions for left & middle buttons (Closed)
Patch Set: Created 4 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 unified diff | Download patch
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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 this.addHighlightedText_(a, tab.title); 279 this.addHighlightedText_(a, tab.title);
280 // Add a tooltip, since it might be ellipsized. The ones that are not 280 // Add a tooltip, since it might be ellipsized. The ones that are not
281 // necessary will be removed once added to the document, so we can 281 // necessary will be removed once added to the document, so we can
282 // compute sizes. 282 // compute sizes.
283 a.title = tab.title; 283 a.title = tab.title;
284 284
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 if (e.button !== 0 && e.button !== 1)
290 return; // Ignore buttons other than left and middle.
Dan Beam 2016/09/12 19:18:59 changing this code is fine, i suppose, but this wi
Navid Zolghadr 2016/09/12 19:50:09 To be honest with you the reported bug wasn't abou
289 recordUmaEvent_(HISTOGRAM_EVENT.LINK_CLICKED); 291 recordUmaEvent_(HISTOGRAM_EVENT.LINK_CLICKED);
290 chrome.send('openForeignSession', [sessionTag, windowId, tabId, 292 chrome.send('openForeignSession', [sessionTag, windowId, tabId,
291 e.button, e.altKey, e.ctrlKey, e.metaKey, e.shiftKey]); 293 e.button, e.altKey, e.ctrlKey, e.metaKey, e.shiftKey]);
292 e.preventDefault(); 294 e.preventDefault();
293 }; 295 };
294 }; 296 };
295 ['click', 'auxclick'].forEach(function(eventName) { 297 ['click', 'auxclick'].forEach(function(eventName) {
296 a.addEventListener(eventName, 298 a.addEventListener(eventName,
297 makeClickHandler(sessionTag, 299 makeClickHandler(sessionTag,
298 String(win.sessionId), 300 String(win.sessionId),
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 devicesView.setSearchText($('search-field').value); 583 devicesView.setSearchText($('search-field').value);
582 }; 584 };
583 $('search-field').addEventListener('search', doSearch); 585 $('search-field').addEventListener('search', doSearch);
584 $('search-button').addEventListener('click', doSearch); 586 $('search-button').addEventListener('click', doSearch);
585 587
586 chrome.send('otherDevicesInitialized'); 588 chrome.send('otherDevicesInitialized');
587 } 589 }
588 590
589 // Add handlers to HTML elements. 591 // Add handlers to HTML elements.
590 document.addEventListener('DOMContentLoaded', load); 592 document.addEventListener('DOMContentLoaded', load);
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/md_downloads/crisper.js » ('j') | chrome/browser/resources/md_downloads/crisper.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698