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

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

Issue 1963823002: Dispatch middle click manually by tracking mouse (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 var middleButtonMouseDownTarget = null;
5 document.addEventListener('mousedown', function(e) {
6 if (e.button == 1) {
7 middleButtonMouseDownTarget = e.target;
8 }
9 }, true);
10 document.addEventListener('mouseup', function(e) {
11 if (e.button == 1 && e.target == middleButtonMouseDownTarget) {
12 e.target.dispatchEvent(new MouseEvent('click', e));
dtapuska 2016/05/10 12:27:15 The middleButtonMouseDownTarget should always like
Navid Zolghadr 2016/05/10 13:17:40 I don't quite understand what you are suggesting h
13 middleButtonMouseDownTarget = null;
14 }
15 }, true);
OLDNEW
« no previous file with comments | « chrome/browser/resources/ntp4/compiled_resources.gyp ('k') | chrome/browser/resources/ntp4/new_tab.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698