diff options
author | sanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-18 00:34:25 +0000 |
---|---|---|
committer | sanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-18 00:34:25 +0000 |
commit | 1a271461fe27a82400f219a33d78ecef9bc40909 (patch) | |
tree | 33c12710af5ca7f7685f959b01e83de717e6ed1d /chrome | |
parent | bc4499508b2c0bc7b6be334acd4eebb5ee176e8d (diff) | |
download | chromium_src-1a271461fe27a82400f219a33d78ecef9bc40909.zip chromium_src-1a271461fe27a82400f219a33d78ecef9bc40909.tar.gz chromium_src-1a271461fe27a82400f219a33d78ecef9bc40909.tar.bz2 |
Fixed a corner case issue with printing XPS documents to the Microsoft XPS Document Writer which would not generate a job id.
BUG=None
TEST=Test submitting an XPS document to the XPS Document Writer via cloud print.
Review URL: http://codereview.chromium.org/6544002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75333 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/service/cloud_print/print_system_win.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/chrome/service/cloud_print/print_system_win.cc b/chrome/service/cloud_print/print_system_win.cc index 4a09ff5..7c8c674 100644 --- a/chrome/service/cloud_print/print_system_win.cc +++ b/chrome/service/cloud_print/print_system_win.cc @@ -464,6 +464,8 @@ class PrintSystemWin : public PrintSystem { // base::win::ObjectWatcher::Delegate inplementation. virtual void OnObjectSignaled(HANDLE object) { DCHECK(xps_print_job_); + DCHECK(object == job_progress_event_.Get()); + ResetEvent(job_progress_event_.Get()); if (!delegate_) return; XPS_JOB_STATUS job_status = {0}; @@ -473,11 +475,14 @@ class PrintSystemWin : public PrintSystem { (job_status.completion == XPS_JOB_FAILED)) { delegate_->OnJobSpoolFailed(); done = true; - } else if (job_status.jobId) { + } else if (job_status.jobId || + (job_status.completion == XPS_JOB_COMPLETED)) { + // Note: In the case of the XPS document being printed to the + // Microsoft XPS Document Writer, it seems to skip spooling the job + // and goes to the completed state without ever assigning a job id. delegate_->OnJobSpoolSucceeded(job_status.jobId); done = true; } else { - ResetEvent(job_progress_event_.Get()); job_progress_watcher_.StopWatching(); job_progress_watcher_.StartWatching(job_progress_event_.Get(), this); } @@ -780,8 +785,8 @@ bool PrintSystemWin::ValidatePrintTicket( } bool PrintSystemWin::GetJobDetails(const std::string& printer_name, - PlatformJobId job_id, - PrintJobDetails *job_details) { + PlatformJobId job_id, + PrintJobDetails *job_details) { DCHECK(job_details); HANDLE printer_handle = NULL; std::wstring printer_name_wide = UTF8ToWide(printer_name); |