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

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

Issue 2503633002: Propagate browser zoom changes to embedded PDFs. (Closed)
Patch Set: Apply internal pdf zoom to browser zoom. Created 4 years, 1 month 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/viewport.js
diff --git a/chrome/browser/resources/pdf/viewport.js b/chrome/browser/resources/pdf/viewport.js
index 80a5a06ac646bb69e61dcda69a07bfb53a2ea208..a0aa409670f3d35ae7c870839e7cf797ec9f106e 100644
--- a/chrome/browser/resources/pdf/viewport.js
+++ b/chrome/browser/resources/pdf/viewport.js
@@ -54,7 +54,8 @@ function frameToPluginCoordinate(coordinateInFrame) {
* @param {Function} beforeZoomCallback is run before a change in zoom
* @param {Function} afterZoomCallback is run after a change in zoom
* @param {number} scrollbarWidth the width of scrollbars on the page
- * @param {number} defaultZoom The default zoom level.
+ * @param {number} initialZoom The zoom level when the pdf viewer is
+ * initialized.
* @param {number} topToolbarHeight The number of pixels that should initially
* be left blank above the document for the toolbar.
*/
@@ -64,7 +65,7 @@ function Viewport(window,
beforeZoomCallback,
afterZoomCallback,
scrollbarWidth,
- defaultZoom,
+ initialZoom,
topToolbarHeight) {
this.window_ = window;
this.sizer_ = sizer;
@@ -77,7 +78,7 @@ function Viewport(window,
this.pageDimensions_ = [];
this.scrollbarWidth_ = scrollbarWidth;
this.fittingType_ = Viewport.FittingType.NONE;
- this.defaultZoom_ = defaultZoom;
+ this.initialZoom_ = initialZoom;
this.topToolbarHeight_ = topToolbarHeight;
this.prevScale_ = 1;
this.pinchPhase_ = Viewport.PinchPhase.PINCH_NONE;
@@ -728,7 +729,7 @@ Viewport.prototype = {
this.pageDimensions_ = this.documentDimensions_.pageDimensions;
if (initialDimensions) {
this.setZoomInternal_(
- Math.min(this.defaultZoom_,
+ Math.min(this.initialZoom_,
this.computeFittingZoom_(this.documentDimensions_, true)));
this.position = {
x: 0,

Powered by Google App Engine
This is Rietveld 408576698