Chromium Code Reviews| Index: chrome/browser/resources/pdf/pdf.js |
| diff --git a/chrome/browser/resources/pdf/pdf.js b/chrome/browser/resources/pdf/pdf.js |
| index e3cd1f346c96643af0e7550fb2da638d896e0f41..2d244062de7a3f8b4dc451f742772ce166f36853 100644 |
| --- a/chrome/browser/resources/pdf/pdf.js |
| +++ b/chrome/browser/resources/pdf/pdf.js |
| @@ -95,6 +95,13 @@ PDFViewer.MIN_TOOLBAR_OFFSET = 15; |
| PDFViewer.MATERIAL_TOOLBAR_HEIGHT = 56; |
| /** |
| + * Minimum height for the material toolbar to show (px). Should match the media |
| + * query in index-material.css. If the window is smaller than this at load, |
| + * leave no space for the toolbar. |
| + */ |
| +PDFViewer.TOOLBAR_WINDOW_MIN_HEIGHT = 250; |
| + |
| +/** |
| * The light-gray background color used for print preview. |
| */ |
| PDFViewer.LIGHT_BACKGROUND_COLOR = '0xFFCCCCCC'; |
| @@ -143,8 +150,9 @@ function PDFViewer(browserApi) { |
| } |
| // Create the viewport. |
| + var shortWindow = window.innerHeight < PDFViewer.TOOLBAR_WINDOW_MIN_HEIGHT; |
|
raymes
2015/09/28 07:42:45
Perhaps we should set the toolbar to display none
tsergeant
2015/09/30 01:26:48
The media query is nice because it automatically u
|
| var topToolbarHeight = |
| - (this.isMaterial_ && !this.isPrintPreview_) ? |
| + (this.isMaterial_ && !this.isPrintPreview_ && !shortWindow) ? |
| PDFViewer.MATERIAL_TOOLBAR_HEIGHT : 0; |
| this.viewport_ = new Viewport(window, |
| this.sizer_, |