Index: chrome/browser/local_discovery/privet_http_impl.cc |
diff --git a/chrome/browser/local_discovery/privet_http_impl.cc b/chrome/browser/local_discovery/privet_http_impl.cc |
index af5fba17835d658058bab6d3dab4a711c6bacf6b..f9ba59e56d543194c40f977e4b6301cf2dc4ff50 100644 |
--- a/chrome/browser/local_discovery/privet_http_impl.cc |
+++ b/chrome/browser/local_discovery/privet_http_impl.cc |
@@ -548,9 +548,8 @@ void PrivetLocalPrintOperationImpl::OnSubmitdocResponse( |
// This error is only relevant in the case of extended workflow: |
// If the print job ID is invalid, retry createjob and submitdoc, |
// rather than simply retrying the current request. |
- if (has_error) { |
+ if (has_error && value->GetString(kPrivetKeyError, &error)) { |
if (has_extended_workflow_ && |
- value->GetString(kPrivetKeyError, &error) && |
error == kPrivetErrorInvalidPrintJob && |
invalid_job_retries_ < kPrivetLocalPrintMaxRetries) { |
invalid_job_retries_++; |
@@ -569,6 +568,9 @@ void PrivetLocalPrintOperationImpl::OnSubmitdocResponse( |
FROM_HERE, base::Bind(&PrivetLocalPrintOperationImpl::DoCreatejob, |
weak_factory_.GetWeakPtr()), |
base::TimeDelta::FromSeconds(timeout)); |
+ } else if (use_pdf_ && error == kPrivetErrorInvalidDocumentType) { |
+ use_pdf_ = false; |
+ delegate_->OnPrivetPrintingRequestPWGRaster(this); |
} else { |
delegate_->OnPrivetPrintingError(this, 200); |
} |
@@ -576,7 +578,6 @@ void PrivetLocalPrintOperationImpl::OnSubmitdocResponse( |
return; |
} |
- |
// If we've gotten this far, there are no errors, so we've effectively |
// succeeded. |
delegate_->OnPrivetPrintingDone(this); |
@@ -659,7 +660,7 @@ void PrivetLocalPrintOperationImpl::SetOffline(bool offline) { |
} |
void PrivetLocalPrintOperationImpl::SendDataInternal() { |
- if (has_extended_workflow_ && !ticket_.empty()) { |
+ if (has_extended_workflow_ && !ticket_.empty() && jobid_.empty()) { |
DoCreatejob(); |
} else { |
DoSubmitdoc(); |