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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.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: Adding remote debugging auxclick polyfill 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 if (!measuring) 1074 if (!measuring)
1075 this._titleElement = titleElement; 1075 this._titleElement = titleElement;
1076 1076
1077 if (this._closeable) 1077 if (this._closeable)
1078 tabElement.createChild("div", "tabbed-pane-close-button", "dt-close- button").gray = true; 1078 tabElement.createChild("div", "tabbed-pane-close-button", "dt-close- button").gray = true;
1079 1079
1080 if (measuring) { 1080 if (measuring) {
1081 tabElement.classList.add("measuring"); 1081 tabElement.classList.add("measuring");
1082 } else { 1082 } else {
1083 tabElement.addEventListener("click", this._tabClicked.bind(this), fa lse); 1083 tabElement.addEventListener("click", this._tabClicked.bind(this), fa lse);
1084 tabElement.addEventListener("auxclick", this._tabClicked.bind(this), false);
dgozman 2016/08/03 20:54:28 I took a closer look, and now I think that we can
Navid Zolghadr 2016/08/03 21:35:20 Awesome. Then I will get rid of that polyfill. Reg
dgozman 2016/08/03 22:31:49 Thanks for explanation.
1084 tabElement.addEventListener("mousedown", this._tabMouseDown.bind(thi s), false); 1085 tabElement.addEventListener("mousedown", this._tabMouseDown.bind(thi s), false);
1085 tabElement.addEventListener("mouseup", this._tabMouseUp.bind(this), false); 1086 tabElement.addEventListener("mouseup", this._tabMouseUp.bind(this), false);
1086 1087
1087 tabElement.addEventListener("contextmenu", this._tabContextMenu.bind (this), false); 1088 tabElement.addEventListener("contextmenu", this._tabContextMenu.bind (this), false);
1088 if (this._tabbedPane._allowTabReorder) 1089 if (this._tabbedPane._allowTabReorder)
1089 WebInspector.installDragHandle(tabElement, this._startTabDraggin g.bind(this), this._tabDragging.bind(this), this._endTabDragging.bind(this), "-w ebkit-grabbing", "pointer", 200); 1090 WebInspector.installDragHandle(tabElement, this._startTabDraggin g.bind(this), this._tabDragging.bind(this), this._endTabDragging.bind(this), "-w ebkit-grabbing", "pointer", 200);
1090 } 1091 }
1091 1092
1092 return tabElement; 1093 return tabElement;
1093 }, 1094 },
1094 1095
1095 /** 1096 /**
1096 * @param {!Event} event 1097 * @param {!Event} event
1097 */ 1098 */
1098 _tabClicked: function(event) 1099 _tabClicked: function(event)
1099 { 1100 {
1100 var middleButton = event.button === 1; 1101 var middleButton = event.button === 1;
dgozman 2016/08/03 20:54:28 Does the event.button work for auxclick? Will it c
Navid Zolghadr 2016/08/03 21:35:20 Yes. It works for both. Basically they have the sa
1101 var shouldClose = this._closeable && (middleButton || event.target.class List.contains("tabbed-pane-close-button")); 1102 var shouldClose = this._closeable && (middleButton || event.target.class List.contains("tabbed-pane-close-button"));
1102 if (!shouldClose) { 1103 if (!shouldClose) {
1103 this._tabbedPane.focus(); 1104 this._tabbedPane.focus();
1104 return; 1105 return;
1105 } 1106 }
1106 this._closeTabs([this.id]); 1107 this._closeTabs([this.id]);
1107 event.consume(true); 1108 event.consume(true);
1108 }, 1109 },
1109 1110
1110 /** 1111 /**
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
1422 * @this {WebInspector.ExtensibleTabbedPaneController} 1423 * @this {WebInspector.ExtensibleTabbedPaneController}
1423 */ 1424 */
1424 function cacheView(object) 1425 function cacheView(object)
1425 { 1426 {
1426 var view = /** @type {!WebInspector.Widget} */ (object); 1427 var view = /** @type {!WebInspector.Widget} */ (object);
1427 this._tabbedPane.changeTabView(id, view); 1428 this._tabbedPane.changeTabView(id, view);
1428 return view; 1429 return view;
1429 } 1430 }
1430 } 1431 }
1431 } 1432 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698