Index: chrome/browser/resources/shared/js/util.js |
diff --git a/chrome/browser/resources/shared/js/util.js b/chrome/browser/resources/shared/js/util.js |
index baa88afd1fa73b4b8a1ec9e6220041c2b2e080d5..230a2413e418724e876bcc46e034bdc5e0b88501 100644 |
--- a/chrome/browser/resources/shared/js/util.js |
+++ b/chrome/browser/resources/shared/js/util.js |
@@ -70,4 +70,25 @@ function parseQueryParams(location) { |
params[pair[0]] = pair[1]; |
} |
return params; |
- } |
+} |
+ |
+function handleFileOrAboutLinkClicks(link) { |
arv (Not doing code reviews)
2011/01/21 23:07:32
Please use a global handler instead.
function han
|
+ // Handle left clicks. |
+ link.onclick = function(event) { |
+ if (link.href.search('file:') == 0 || |
+ link.href.search('about:') == 0) { |
+ chrome.send('navigateToUrl', [link.href, '0']); |
+ return false; |
+ } |
+ }; |
+ |
+ // Handle middle clicks. |
+ link.onmouseup = function(event) { |
+ if (event.button == 1 && |
+ (link.href.search('file:') == 0 || |
+ link.href.search('about:') == 0)) { |
+ chrome.send('navigateToUrl', [link.href, '1']); |
+ return false; |
+ } |
+ }; |
+} |