Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1310)

Unified Diff: chrome/browser/resources/print_preview.js

Issue 7063030: PrintPreview: Print Preview is not staying associated with initiator renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed thestig@ comments. Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/print_preview.js
diff --git a/chrome/browser/resources/print_preview.js b/chrome/browser/resources/print_preview.js
index 0bb91592798d17702f4599d8b70922069db6ad5c..5260a2b063288360c42fdc9068b0ef27334ec222 100644
--- a/chrome/browser/resources/print_preview.js
+++ b/chrome/browser/resources/print_preview.js
@@ -470,9 +470,9 @@ 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} previewUid Preview unique identifier.
*/
-function updatePrintPreview(pageCount, jobTitle, modifiable) {
+function updatePrintPreview(pageCount, jobTitle, modifiable, previewUid) {
var tempPrintSettings = new PrintSettings();
tempPrintSettings.save();
@@ -506,7 +506,7 @@ function updatePrintPreview(pageCount, jobTitle, modifiable) {
// Update the current tab title.
document.title = localStrings.getStringF('printPreviewTitleFormat', jobTitle);
- createPDFPlugin();
+ createPDFPlugin(previewUid);
updatePrintSummary();
updatePrintButtonState();
addEventListeners();
@@ -514,8 +514,9 @@ function updatePrintPreview(pageCount, jobTitle, modifiable) {
/**
* Create the PDF plugin or reload the existing one.
+ * @param {string} previewUid Preview unique identifier.
*/
-function createPDFPlugin() {
+function createPDFPlugin(previewUid) {
// Enable the print button.
if (!$('printer-list').disabled) {
$('print-button').disabled = false;
@@ -538,7 +539,7 @@ 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/' + previewUid + '/print.pdf');
var mainView = $('mainview');
mainView.appendChild(pdfPlugin);
pdfPlugin.onload('onPDFLoad()');

Powered by Google App Engine
This is Rietveld 408576698