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

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

Issue 904553002: Make pinch-zoom work for OOP PDF (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « chrome/browser/resources/pdf/index.css ('k') | extensions/browser/guest_view/guest_view_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/pdf/pdf.js
diff --git a/chrome/browser/resources/pdf/pdf.js b/chrome/browser/resources/pdf/pdf.js
index ef62ca7988c55396a7a89d59c0ff8b0b991caa07..101c7c9ab4a609fdfe7559ec77d369ae17daab02 100644
--- a/chrome/browser/resources/pdf/pdf.js
+++ b/chrome/browser/resources/pdf/pdf.js
@@ -108,9 +108,6 @@ function PDFViewer(streamDetails) {
this.plugin_.type = 'application/x-google-chrome-pdf';
this.plugin_.addEventListener('message', this.handlePluginMessage_.bind(this),
false);
- this.plugin_.style.height =
- (window.innerHeight - this.toolbarHeight_) + 'px';
- this.plugin_.style.width = window.innerWidth + 'px';
if (this.isMaterial_)
this.plugin_.setAttribute('is-material', '');
@@ -556,16 +553,6 @@ PDFViewer.prototype = {
* A callback that's called after the viewport changes.
*/
viewportChanged_: function() {
- var hasScrollbars = this.viewport_.documentHasScrollbars();
- var scrollbarWidth = this.viewport_.scrollbarWidth;
- var verticalScrollbarWidth = hasScrollbars.vertical ? scrollbarWidth : 0;
- var horizontalScrollbarWidth =
- hasScrollbars.horizontal ? scrollbarWidth : 0;
- this.plugin_.style.width =
- (window.innerWidth - verticalScrollbarWidth) + 'px';
- this.plugin_.style.height = (window.innerHeight -
- horizontalScrollbarWidth - this.toolbarHeight_) + 'px';
-
if (!this.documentDimensions_)
return;
@@ -580,6 +567,11 @@ PDFViewer.prototype = {
}
// Offset the toolbar position so that it doesn't move if scrollbars appear.
+ var hasScrollbars = this.viewport_.documentHasScrollbars();
+ var scrollbarWidth = this.viewport_.scrollbarWidth;
+ var verticalScrollbarWidth = hasScrollbars.vertical ? scrollbarWidth : 0;
+ var horizontalScrollbarWidth =
+ hasScrollbars.horizontal ? scrollbarWidth : 0;
var toolbarRight = Math.max(PDFViewer.MIN_TOOLBAR_OFFSET, scrollbarWidth);
var toolbarBottom = Math.max(PDFViewer.MIN_TOOLBAR_OFFSET, scrollbarWidth);
toolbarRight -= verticalScrollbarWidth;
« no previous file with comments | « chrome/browser/resources/pdf/index.css ('k') | extensions/browser/guest_view/guest_view_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698