Index: chrome/browser/resources/shared/js/util.js |
=================================================================== |
--- chrome/browser/resources/shared/js/util.js (revision 75983) |
+++ chrome/browser/resources/shared/js/util.js (working copy) |
@@ -108,12 +108,9 @@ |
aParent.insertBefore(b, afterA); |
} |
-/* |
- * Handles a click or mouseup on a link. If the link points to a chrome: or |
- * file: url, then call into the browser to do the navigation. |
- * @return {Object} e The click or mouseup event. |
- */ |
-function handleLinkClickOrMouseUp(e) { |
+// Handle click on a link. If the link points to a chrome: or file: url, then |
+// call into the browser to do the navigation. |
+document.addEventListener('click', function(e) { |
var el = e.target; |
if (el.nodeType == Node.ELEMENT_NODE && |
el.webkitMatchesSelector('A, A *')) { |
@@ -122,15 +119,10 @@ |
} |
if ((el.protocol == 'file:' || el.protocol == 'about:') && |
- ((e.button == 0 && e.type == 'click') || |
- (e.button == 1 && e.type == 'mouseup'))) { |
+ (e.button == 0 || e.button == 1)) { |
chrome.send('navigateToUrl', |
- [el.href, String(e.button), String(e.ctrlKey), String(e.shiftKey), |
- String(e.altKey)]); |
+ [el.href, e.button, e.altKey, e.ctrlKey, e.metaKey, e.shiftKey]); |
e.preventDefault(); |
} |
} |
-} |
- |
-document.addEventListener('click', handleLinkClickOrMouseUp, true); |
-document.addEventListener('mouseup', handleLinkClickOrMouseUp, true); |
+}); |