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

Unified Diff: chrome/browser/resources/pdf/pdf.js

Issue 2149153003: Links in PDF should be opened in new background tabs when ctrl + left clicked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/pdf/pdf.js
diff --git a/chrome/browser/resources/pdf/pdf.js b/chrome/browser/resources/pdf/pdf.js
index 2fb87f5dd83c20b6d770b54030f4b7d16409090c..bb7118e9083e741bb0ccdc4b4671973b3844c911 100644
--- a/chrome/browser/resources/pdf/pdf.js
+++ b/chrome/browser/resources/pdf/pdf.js
@@ -56,14 +56,14 @@ function onNavigateInCurrentTab(isInTab, isSourceFileUrl, url) {
}
/**
- * Called when navigation happens in the new tab.
- * @param {string} url The url to be opened in the new tab.
+ * Called when navigation happens in the new background tab.
+ * @param {string} url The url to be opened in the new background tab.
*/
-function onNavigateInNewTab(url) {
+function onNavigateInNewBackgroundTab(url) {
// Prefer the tabs API because it guarantees we can just open a new tab.
// window.open doesn't have this guarantee.
if (chrome.tabs)
- chrome.tabs.create({url: url});
+ chrome.tabs.create({url: url, active: false});
else
window.open(url);
jaepark 2016/07/14 22:52:39 I wasn't able to find a way to create a new backgr
Lei Zhang 2016/07/14 22:57:52 I think this is just best effort.
jaepark 2016/07/15 00:23:56 Acknowledged.
}
@@ -264,7 +264,7 @@ function PDFViewer(browserApi) {
onNavigateInCurrentTab.bind(undefined,
isInTab,
isSourceFileUrl),
- onNavigateInNewTab);
+ onNavigateInNewBackgroundTab);
this.viewportScroller_ =
new ViewportScroller(this.viewport_, this.plugin_, window);
« chrome/browser/pdf/pdf_extension_test.cc ('K') | « chrome/browser/resources/pdf/navigator.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698