summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/print_preview.js
diff options
context:
space:
mode:
authorkmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-22 17:03:17 +0000
committerkmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-22 17:03:17 +0000
commit3fdc97f78b89d1f8d20b2329a71f93adc9a5e31d (patch)
tree5171a0f00de56d264d072bd753a50304a3f2dbff /chrome/browser/resources/print_preview.js
parenteae8081acbe5261ab9fecabe975c787c4df8d1bf (diff)
downloadchromium_src-3fdc97f78b89d1f8d20b2329a71f93adc9a5e31d.zip
chromium_src-3fdc97f78b89d1f8d20b2329a71f93adc9a5e31d.tar.gz
chromium_src-3fdc97f78b89d1f8d20b2329a71f93adc9a5e31d.tar.bz2
PrintPreview: Send the expected pages count value to Web UI along with preview data.
To display initial page range text, we need expected pages count value. Therefore, I added a |expected_pages_count| field to ViewHostMsg_DidPreviewDocument_Params structure. BUG=none TEST=Enable print preview on mac. In the preview tab after loading the preview data an initial page range text is displayed. Review URL: http://codereview.chromium.org/6542002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75599 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources/print_preview.js')
-rw-r--r--chrome/browser/resources/print_preview.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/chrome/browser/resources/print_preview.js b/chrome/browser/resources/print_preview.js
index 6c3aee2..7dfc1ab 100644
--- a/chrome/browser/resources/print_preview.js
+++ b/chrome/browser/resources/print_preview.js
@@ -4,6 +4,7 @@
var localStrings = new LocalStrings();
var hasPDFPlugin = true;
+var expectedPageCount = 0;
/**
* Window onload handler, sets up the page.
@@ -45,10 +46,16 @@ function onPDFLoad() {
/**
* Create the PDF plugin or reload the existing one.
*/
-function createPDFPlugin(url) {
+function createPDFPlugin(url, pagesCount) {
if (!hasPDFPlugin) {
return;
}
+ // Set the expected pages count.
+ if (expectedPageCount != pagesCount) {
+ expectedPageCount = pagesCount;
+ // Set the initial page range text.
+ $('pages').value = '1-' + expectedPageCount;
+ }
if ($('pdf-viewer')) {
$('pdf-viewer').reload();