Skip to content

Commit

Permalink
Fix history page middle click action
Browse files Browse the repository at this point in the history
Send synthetic middle click in history page and also
prevent default it as the links in history page will
trigger twice if we don't prevent default it.

BUG=609020
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2018943003
Cr-Commit-Position: refs/heads/master@{#397512}
(cherry picked from commit a154aed)

Review URL: https://codereview.chromium.org/2040813003 .

Cr-Commit-Position: refs/branch-heads/2743@{crosswalk-project#242}
Cr-Branched-From: 2b3ae3b-refs/heads/master@{#394939}
  • Loading branch information
dtapuska committed Jun 6, 2016
1 parent 774c808 commit 20cd211
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions chrome/browser/resources/history/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

<include src="../synthetic_middleclick.js">
<include src="../uber/uber_utils.js">
<include src="history_focus_manager.js">

Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/resources/ntp4/new_tab.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<script src="../../../../ui/webui/resources/js/cr/ui/context_menu_button.js"></script>
<script src="../../../../ui/webui/resources/js/cr/ui/touch_handler.js"></script>

<script src="synthetic_middleclick.js"></script>
<script src="../synthetic_middleclick.js"></script>
<script src="tile_page.js"></script>
<script src="apps_page.js"></script>
<script src="dot_list.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ document.addEventListener('mouseup', function(e) {
middleButtonMouseDownTarget = null;
}, true);

window.addEventListener('click', function(e) {
if (e.button == 1 && !e.isTrusted)
e.preventDefault();
});

})();

0 comments on commit 20cd211

Please sign in to comment.