| Index: chrome/browser/resources/pdf/pdf.js
|
| diff --git a/chrome/browser/resources/pdf/pdf.js b/chrome/browser/resources/pdf/pdf.js
|
| index c9b50d9d9c72eda9eee4a42f1cf9e631ee3c64a1..1e030d6acc63ade88cc741d0afc0f57fb14f0224 100644
|
| --- a/chrome/browser/resources/pdf/pdf.js
|
| +++ b/chrome/browser/resources/pdf/pdf.js
|
| @@ -112,6 +112,10 @@ function PDFViewer(streamDetails) {
|
| this.plugin_.setAttribute('full-frame', '');
|
| document.body.appendChild(this.plugin_);
|
|
|
| + this.pageIndicator_.addEventListener('changePage', function(e) {
|
| + this.viewport_.goToPage(e.detail.page);
|
| + }.bind(this));
|
| +
|
| // Setup the button event listeners.
|
| $('fit-to-width-button').addEventListener('click',
|
| this.viewport_.fitToWidth.bind(this.viewport_));
|
| @@ -338,6 +342,8 @@ PDFViewer.prototype = {
|
| // Document load complete.
|
| if (this.lastViewportPosition_)
|
| this.viewport_.position = this.lastViewportPosition_;
|
| + if (this.isMaterial_)
|
| + this.pageIndicator_.style.visibility = 'visible';
|
| this.handleURLParams_();
|
| this.loaded_ = true;
|
| this.sendScriptingMessage_({
|
| @@ -436,7 +442,13 @@ PDFViewer.prototype = {
|
| if (this.passwordScreen_.active)
|
| this.passwordScreen_.accept();
|
|
|
| - this.pageIndicator_.initialFadeIn();
|
| + if (this.isMaterial_) {
|
| + this.pageIndicator_.docLength =
|
| + this.documentDimensions_.pageDimensions.length;
|
| + } else {
|
| + this.pageIndicator_.initialFadeIn();
|
| + }
|
| +
|
| this.toolbar_.initialFadeIn();
|
| break;
|
| case 'email':
|
| @@ -593,11 +605,13 @@ PDFViewer.prototype = {
|
| // Update the page indicator.
|
| var visiblePage = this.viewport_.getMostVisiblePage();
|
| this.pageIndicator_.index = visiblePage;
|
| - if (this.documentDimensions_.pageDimensions.length > 1 &&
|
| - hasScrollbars.vertical) {
|
| - this.pageIndicator_.style.visibility = 'visible';
|
| - } else {
|
| - this.pageIndicator_.style.visibility = 'hidden';
|
| + if (!this.isMaterial_) {
|
| + if (this.documentDimensions_.pageDimensions.length > 1 &&
|
| + hasScrollbars.vertical) {
|
| + this.pageIndicator_.style.visibility = 'visible';
|
| + } else {
|
| + this.pageIndicator_.style.visibility = 'hidden';
|
| + }
|
| }
|
|
|
| var visiblePageDimensions = this.viewport_.getPageScreenRect(visiblePage);
|
|
|