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

Unified Diff: chrome/service/cloud_print/print_system_win.cc

Issue 6544002: Fixed a corner case issue with printing XPS documents to the Microsoft XPS Do... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/service/cloud_print/print_system_win.cc
===================================================================
--- chrome/service/cloud_print/print_system_win.cc (revision 75286)
+++ chrome/service/cloud_print/print_system_win.cc (working copy)
@@ -464,6 +464,8 @@
// 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 @@
(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::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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698