diff options
author | vitalybuka <vitalybuka@chromium.org> | 2015-08-04 16:19:02 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-04 23:20:47 +0000 |
commit | 0bb69c7f9ab18c6e79dd607ee6ab405231964dac (patch) | |
tree | 40b05aa3555cb0d35a95170992fdb7347d85c174 /chrome/browser/resources/pdf/pdf.js | |
parent | 2bcebfbff86ffc73ee01f58a67e15541ffa4a150 (diff) | |
download | chromium_src-0bb69c7f9ab18c6e79dd607ee6ab405231964dac.zip chromium_src-0bb69c7f9ab18c6e79dd607ee6ab405231964dac.tar.gz chromium_src-0bb69c7f9ab18c6e79dd607ee6ab405231964dac.tar.bz2 |
Revert of Add a scroll offset to PDF documents to account for the top material design toolbar. (patchset #7 id:120001 of https://codereview.chromium.org/1255403002/ )
Reason for revert:
This patch breaks print preview.
BUG=516829
Original issue's description:
> Add a scroll offset to PDF documents to account for the top material design toolbar.
>
> Previously the toolbar in the material design PDF UI would always cover the top
> of pages when it was first loaded or when a page was navigated to using the
> page selector. Now we ensure that a blank region is left at the very top of
> the document when it is first loaded. This is the region that the toolbar
> covers, so the document is not obscured at all. When pages are navigated to, we
> ensure that the top of the selected page is always underneath the toolbar
> so that it is not obscured. The one exception to this is when in fit-to-page
> mode which causes the page to be zoomed to cover the entire screen, ignoring
> the toolbar. This is so that users can take advantaging of filling all of the
> screen real-estate with a page when that is what they want.
>
> This is implemented by initially scrolling the document to a negative offset
> (which is equal to the toolbar height). All subsequent scrolls are relative
> to this initial scroll. A few small bugs that assumed there was no blank space
> above the first page have also been fixed.
>
> BUG=439114
>
> Committed: https://crrev.com/daad0f1f879b13c8b55797ae5ce106d382283047
> Cr-Commit-Position: refs/heads/master@{#341685}
TBR=sammc@chromium.org,tsergeant@chromium.org,raymes@chromium.org
BUG=439114
Review URL: https://codereview.chromium.org/1267553004
Cr-Commit-Position: refs/heads/master@{#341820}
Diffstat (limited to 'chrome/browser/resources/pdf/pdf.js')
-rw-r--r-- | chrome/browser/resources/pdf/pdf.js | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/chrome/browser/resources/pdf/pdf.js b/chrome/browser/resources/pdf/pdf.js index 3fb6148..dfa2d31 100644 --- a/chrome/browser/resources/pdf/pdf.js +++ b/chrome/browser/resources/pdf/pdf.js @@ -75,12 +75,6 @@ function shouldIgnoreKeyEvents(activeElement) { PDFViewer.MIN_TOOLBAR_OFFSET = 15; /** - * The height of the toolbar along the top of the page. The document will be - * shifted down by this much in the viewport. - */ -PDFViewer.MATERIAL_TOOLBAR_HEIGHT = 64; - -/** * Creates a new PDFViewer. There should only be one of these objects per * document. * @constructor @@ -110,16 +104,13 @@ function PDFViewer(browserApi) { this.errorScreen_ = $('error-screen'); // Create the viewport. - var topToolbarHeight = - this.isMaterial_ ? PDFViewer.MATERIAL_TOOLBAR_HEIGHT : 0; this.viewport_ = new Viewport(window, this.sizer_, this.viewportChanged_.bind(this), this.beforeZoom_.bind(this), this.afterZoom_.bind(this), getScrollbarWidth(), - this.browserApi_.getDefaultZoom(), - topToolbarHeight); + this.browserApi_.getDefaultZoom()); // Create the plugin object dynamically so we can set its src. The plugin // element is sized to fill the entire window and is set to be fixed @@ -152,11 +143,8 @@ function PDFViewer(browserApi) { } this.plugin_.setAttribute('headers', headers); - if (this.isMaterial_) { + if (this.isMaterial_) this.plugin_.setAttribute('is-material', ''); - this.plugin_.setAttribute('top-toolbar-height', - PDFViewer.MATERIAL_TOOLBAR_HEIGHT); - } if (!this.browserApi_.getStreamInfo().embedded) this.plugin_.setAttribute('full-frame', ''); |