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

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: '' 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 c37fc14baff264b2d4a73e9035f7e127aabcded3..c5f081f0eced0dd40490fd7ecee9848118e19fb8 100644
--- a/chrome/browser/resources/print_preview.js
+++ b/chrome/browser/resources/print_preview.js
@@ -504,9 +504,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();
@@ -540,7 +540,7 @@ function updatePrintPreview(pageCount, jobTitle, modifiable) {
// Update the current tab title.
document.title = localStrings.getStringF('printPreviewTitleFormat', jobTitle);
- createPDFPlugin();
+ createPDFPlugin(previewUid);
updatePrintSummary();
updatePrintButtonState();
addEventListeners();
@@ -548,8 +548,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;
@@ -572,7 +573,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()');
« no previous file with comments | « chrome/browser/printing/print_preview_message_handler.cc ('k') | chrome/browser/ui/webui/print_preview_data_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698