deepak1556 2018-04-13 14:13:52 +05:30 committed by Samuel Attard
parent 37d64e6a00
commit 39b30b76ea
13 changed files with 154 additions and 97 deletions

View file

@ -14,7 +14,6 @@
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
#include "base/task_scheduler/post_task.h"
#include "base/threading/sequenced_worker_pool.h"
#include "base/threading/thread_restrictions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
@ -22,7 +21,6 @@
#include "chrome/browser/printing/print_job_worker.h"
#include "content/public/browser/notification_service.h"
#include "printing/printed_document.h"
#include "printing/printed_page.h"
#if defined(OS_WIN)
#include "chrome/browser/printing/pdf_to_emf_converter.h"
@ -129,7 +127,7 @@ void PrintJob::StartPrinting() {
// Tell everyone!
scoped_refptr<JobEventDetails> details(
new JobEventDetails(JobEventDetails::NEW_DOC, document_.get(), nullptr));
new JobEventDetails(JobEventDetails::NEW_DOC, 0, document_.get()));
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_PRINT_JOB_EVENT, content::Source<PrintJob>(this),
content::Details<JobEventDetails>(details.get()));
@ -173,7 +171,7 @@ void PrintJob::Cancel() {
}
// Make sure a Cancel() is broadcast.
scoped_refptr<JobEventDetails> details(
new JobEventDetails(JobEventDetails::FAILED, nullptr, nullptr));
new JobEventDetails(JobEventDetails::FAILED, 0, nullptr));
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_PRINT_JOB_EVENT, content::Source<PrintJob>(this),
content::Details<JobEventDetails>(details.get()));
@ -393,7 +391,7 @@ void PrintJob::OnDocumentDone() {
Stop();
scoped_refptr<JobEventDetails> details(
new JobEventDetails(JobEventDetails::JOB_DONE, document_.get(), nullptr));
new JobEventDetails(JobEventDetails::JOB_DONE, 0, document_.get()));
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_PRINT_JOB_EVENT, content::Source<PrintJob>(this),
content::Details<JobEventDetails>(details.get()));
@ -445,10 +443,18 @@ void PrintJob::Quit() {
}
// Takes settings_ ownership and will be deleted in the receiving thread.
#if defined(OS_WIN)
JobEventDetails::JobEventDetails(Type type,
int job_id,
PrintedDocument* document,
PrintedPage* page)
: document_(document), page_(page), type_(type) {}
: document_(document), page_(page), type_(type), job_id_(job_id) {}
#endif
JobEventDetails::JobEventDetails(Type type,
int job_id,
PrintedDocument* document)
: document_(document), type_(type), job_id_(job_id) {}
JobEventDetails::~JobEventDetails() {}
@ -456,8 +462,7 @@ PrintedDocument* JobEventDetails::document() const {
return document_.get();
}
PrintedPage* JobEventDetails::page() const {
return page_.get();
}
#if defined(OS_WIN)
PrintedPage* JobEventDetails::page() const { return page_.get(); }
#endif
} // namespace printing