| Index: chrome/browser/resources/print_preview.js
|
| diff --git a/chrome/browser/resources/print_preview.js b/chrome/browser/resources/print_preview.js
|
| index b91cf2e83b1855592814a620d870ae49ac66f36a..a2aa9d2f763254807977b30af4c4ea271ffdc052 100644
|
| --- a/chrome/browser/resources/print_preview.js
|
| +++ b/chrome/browser/resources/print_preview.js
|
| @@ -30,6 +30,9 @@ const MANAGE_PRINTERS = 'Manage Printers';
|
| // State of the print preview settings.
|
| var printSettings = new PrintSettings();
|
|
|
| +// Preview UI identifier.
|
| +var previewUIIdentifier = null;
|
| +
|
| /**
|
| * Window onload handler, sets up the page and starts print preview by getting
|
| * the printer list.
|
| @@ -493,12 +496,11 @@ function onPDFLoad() {
|
| * @param {number} pageCount The expected total pages count.
|
| * @param {string} jobTitle The print job title.
|
| * @param {boolean} modifiable If the preview is modifiable.
|
| - *
|
| + * @param {string} previewUIId Preview UI identifier.
|
| */
|
| -function updatePrintPreview(pageCount, jobTitle, modifiable) {
|
| +function updatePrintPreview(pageCount, jobTitle, modifiable, previewUIId) {
|
| var tempPrintSettings = new PrintSettings();
|
| tempPrintSettings.save();
|
| -
|
| previewModifiable = modifiable;
|
|
|
| if (totalPageCount == -1)
|
| @@ -529,6 +531,9 @@ function updatePrintPreview(pageCount, jobTitle, modifiable) {
|
| // Update the current tab title.
|
| document.title = localStrings.getStringF('printPreviewTitleFormat', jobTitle);
|
|
|
| + // Store the preview tab identifier.
|
| + previewUIIdentifier = previewUIId;
|
| +
|
| createPDFPlugin();
|
| updatePrintSummary();
|
| updatePrintButtonState();
|
| @@ -561,7 +566,8 @@ function createPDFPlugin() {
|
| var pdfPlugin = document.createElement('embed');
|
| pdfPlugin.setAttribute('id', 'pdf-viewer');
|
| pdfPlugin.setAttribute('type', 'application/pdf');
|
| - pdfPlugin.setAttribute('src', 'chrome://print/print.pdf');
|
| + pdfPlugin.setAttribute('src',
|
| + 'chrome://print/print.pdf/' + previewUIIdentifier);
|
| var mainView = $('mainview');
|
| mainView.appendChild(pdfPlugin);
|
| pdfPlugin.onload('onPDFLoad()');
|
|
|