Index: chrome/browser/printing/print_view_manager.cc |
diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc |
index 477336e11582d4759b9703f0b5ed884cb6ca5fa0..08f2bb6879c2e6bac2f1a5e4152becd9cc041c85 100644 |
--- a/chrome/browser/printing/print_view_manager.cc |
+++ b/chrome/browser/printing/print_view_manager.cc |
@@ -31,7 +31,6 @@ |
#include "grit/generated_resources.h" |
#include "printing/metafile.h" |
#include "printing/metafile_impl.h" |
-#include "printing/printed_document.h" |
#include "ui/base/l10n/l10n_util.h" |
using base::TimeDelta; |
@@ -101,6 +100,12 @@ bool PrintViewManager::AdvancedPrintNow() { |
} |
} |
+bool PrintViewManager::PrintToDelegate( |
+ PrintedDocument::Delegate* printed_document_delegate) { |
+ printed_document_delegate_ = printed_document_delegate; |
+ return PrintNowInternal(new PrintMsg_PrintForFile(routing_id())); |
+} |
+ |
bool PrintViewManager::PrintPreviewNow() { |
if (print_preview_state_ != NOT_PREVIEWING) { |
NOTREACHED(); |
@@ -465,7 +470,8 @@ bool PrintViewManager::CreateNewPrintJob(PrintJobWorkerOwner* job) { |
return false; |
print_job_ = new PrintJob(); |
- print_job_->Initialize(job, this, number_pages_); |
+ print_job_->Initialize( |
+ job, this, printed_document_delegate_.get(), number_pages_); |
registrar_.Add(this, chrome::NOTIFICATION_PRINT_JOB_EVENT, |
content::Source<PrintJob>(print_job_.get())); |
printing_succeeded_ = false; |
@@ -613,6 +619,7 @@ void PrintViewManager::ReleasePrinterQuery() { |
int cookie = cookie_; |
cookie_ = 0; |
+ printed_document_delegate_ = NULL; |
printing::PrintJobManager* print_job_manager = |
g_browser_process->print_job_manager(); |