| Index: chrome/browser/resources/pdf/pdf.js
|
| diff --git a/chrome/browser/resources/pdf/pdf.js b/chrome/browser/resources/pdf/pdf.js
|
| index 0ca054f9059e8a300f5d05c4ce8f4a4a648bf0d4..7ae5ee31feb1d4f0b9fd4c0e477aac3e3c919013 100644
|
| --- a/chrome/browser/resources/pdf/pdf.js
|
| +++ b/chrome/browser/resources/pdf/pdf.js
|
| @@ -84,7 +84,7 @@ function PDFViewer(streamDetails) {
|
| }
|
| this.plugin_.setAttribute('headers', headers);
|
|
|
| - if (window.top == window)
|
| + if (!this.streamDetails.embedded)
|
| this.plugin_.setAttribute('full-frame', '');
|
| document.body.appendChild(this.plugin_);
|
|
|
| @@ -113,7 +113,7 @@ function PDFViewer(streamDetails) {
|
| document.onkeydown = this.handleKeyEvent_.bind(this);
|
|
|
| // Set up the zoom API.
|
| - if (chrome.tabs) {
|
| + if (this.shouldManageZoom_()) {
|
| chrome.tabs.setZoomSettings(this.streamDetails.tabId,
|
| {mode: 'manual', scope: 'per-tab'},
|
| this.afterZoom_.bind(this));
|
| @@ -422,7 +422,7 @@ PDFViewer.prototype = {
|
| afterZoom_: function() {
|
| var position = this.viewport_.position;
|
| var zoom = this.viewport_.zoom;
|
| - if (chrome.tabs && !this.setZoomInProgress_) {
|
| + if (this.shouldManageZoom_() && !this.setZoomInProgress_) {
|
| this.setZoomInProgress_ = true;
|
| chrome.tabs.setZoom(this.streamDetails.tabId, zoom,
|
| this.setZoomComplete_.bind(this, zoom));
|
| @@ -574,6 +574,17 @@ PDFViewer.prototype = {
|
| },
|
|
|
| /**
|
| + * @private
|
| + * Return whether this PDFViewer should manage zoom for its containing page.
|
| + * @return {boolean} Whether this PDFViewer should manage zoom for its
|
| + * containing page.
|
| + */
|
| + shouldManageZoom_: function() {
|
| + return !!(chrome.tabs && !this.streamDetails.embedded &&
|
| + this.streamDetails.tabId != -1);
|
| + },
|
| +
|
| + /**
|
| * @type {Viewport} the viewport of the PDF viewer.
|
| */
|
| get viewport() {
|
|
|