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

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

Issue 2300243004: Links in PDF should open in a new window when shift + left clicked. (Closed)
Patch Set: Links in PDF should open in a new window when shift + left clicked. Created 4 years, 3 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/navigator.js
diff --git a/chrome/browser/resources/pdf/navigator.js b/chrome/browser/resources/pdf/navigator.js
index 611b4a91bde90a5496d1614ac4e14ec7098e55f9..f9a94f7a0fd3457ec82e94be4d6d5b80e51e87b6 100644
--- a/chrome/browser/resources/pdf/navigator.js
+++ b/chrome/browser/resources/pdf/navigator.js
@@ -13,17 +13,21 @@
* gets called when navigation happens in the current tab.
* @param {Function} navigateInNewTabCallback The Callback function
* that gets called when navigation happens in the new tab.
+ * @param {Function} navigateInNewWindowCallback The Callback function
+ * that gets called when navigation happens in the new window.
*/
function Navigator(originalUrl,
viewport,
paramsParser,
navigateInCurrentTabCallback,
- navigateInNewTabCallback) {
+ navigateInNewTabCallback,
+ navigateInNewWindowCallback) {
raymes 2016/09/05 04:29:32 Now that we're passing 3 functions in here, we may
jaepark 2016/09/06 02:49:56 Done.
this.originalUrl_ = originalUrl;
this.viewport_ = viewport;
this.paramsParser_ = paramsParser;
this.navigateInCurrentTabCallback_ = navigateInCurrentTabCallback;
this.navigateInNewTabCallback_ = navigateInNewTabCallback;
+ this.navigateInNewWindowCallback_ = navigateInNewWindowCallback;
}
/**
@@ -84,10 +88,7 @@ Navigator.prototype = {
this.navigateInNewTabCallback_(url, true);
break;
case Navigator.WindowOpenDisposition.NEW_WINDOW:
- // TODO(jaepark): Shift + left clicking a link in PDF should open the
- // link in a new window. See http://crbug.com/628057.
- this.paramsParser_.getViewportFromUrlParams(
- url, this.onViewportReceived_.bind(this));
+ this.navigateInNewWindowCallback_(url);
break;
case Navigator.WindowOpenDisposition.SAVE_TO_DISK:
// TODO(jaepark): Alt + left clicking a link in PDF should

Powered by Google App Engine
This is Rietveld 408576698