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

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

Issue 147953009: Fallback to CDD/CJT if connector can't initialize XPS API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
Index: chrome/service/cloud_print/printer_job_handler.cc
diff --git a/chrome/service/cloud_print/printer_job_handler.cc b/chrome/service/cloud_print/printer_job_handler.cc
index 0e8a3f8bce06023471067e05098582d286704de8..bb13defc798556d77e8c64712ecfd1e3a60b6b91 100644
--- a/chrome/service/cloud_print/printer_job_handler.cc
+++ b/chrome/service/cloud_print/printer_job_handler.cc
@@ -316,9 +316,18 @@ PrinterJobHandler::HandleJobMetadataResponse(
JOB_HANDLER_JOB_STARTED, JOB_HANDLER_MAX);
SetNextDataHandler(&PrinterJobHandler::HandlePrintTicketResponse);
request_ = CloudPrintURLFetcher::Create();
- request_->StartGetRequest(CloudPrintURLFetcher::REQUEST_TICKET,
- GURL(job_details_.print_ticket_url_), this, kJobDataMaxRetryCount,
- std::string());
+ if (print_system_->UseCddAndCjt()) {
+ request_->StartGetRequest(
+ CloudPrintURLFetcher::REQUEST_TICKET,
+ GetUrlForJobCjt(cloud_print_server_url_, job_details_.job_id_,
+ job_fetch_reason_),
+ this, kJobDataMaxRetryCount, std::string());
+ } else {
+ request_->StartGetRequest(
+ CloudPrintURLFetcher::REQUEST_TICKET,
+ GURL(job_details_.print_ticket_url_), this, kJobDataMaxRetryCount,
+ std::string());
+ }
} else {
job_available = false;
base::MessageLoop::current()->PostDelayedTask(
@@ -683,7 +692,8 @@ void PrinterJobHandler::OnReceivePrinterCaps(
// Hashes don't match, we need to upload new capabilities (the defaults
// go for free along with the capabilities)
printer_info_cloud_.caps_hash = caps_hash;
- if (caps_and_defaults.caps_mime_type == kContentTypeCDD) {
+ if (caps_and_defaults.caps_mime_type == kContentTypeJSON) {
+ DCHECK(print_system_->UseCddAndCjt());
net::AddMultipartValueForUpload(kUseCDD, "true", mime_boundary,
std::string(), &post_data);
}
« no previous file with comments | « chrome/service/cloud_print/print_system_win.cc ('k') | chrome/service/cloud_print/printer_job_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698