Index: cloud_print/gcp20/prototype/printer.cc |
diff --git a/cloud_print/gcp20/prototype/printer.cc b/cloud_print/gcp20/prototype/printer.cc |
index 197f70d473ff8048caa8ff11447906a52393a2cb..9513979f6d9fa6a17dfee852b3d0391e3afc6d3d 100644 |
--- a/cloud_print/gcp20/prototype/printer.cc |
+++ b/cloud_print/gcp20/prototype/printer.cc |
@@ -342,12 +342,15 @@ void Printer::CreateInfo(PrivetHttpServer::DeviceInfo* info) { |
// TODO(maksymb): Create enum for available APIs and replace |
// this API text names with constants from enum. API text names should be only |
// known in PrivetHttpServer. |
- if (state_.registration_state == PrinterState::UNREGISTERED) { |
+ if (!IsRegistered()) { |
info->api.push_back("/privet/register"); |
} else { |
- if (IsLocalPrintingAllowed()) |
- info->api.push_back("/privet/printer/submitdoc"); |
info->api.push_back("/privet/capabilities"); |
+ if (IsLocalPrintingAllowed()) { |
+ info->api.push_back("/privet/printer/createjob"); |
+ info->api.push_back("/privet/printer/submitdoc"); |
+ info->api.push_back("/privet/printer/jobstate"); |
+ } |
} |
info->type.push_back("printer"); |
@@ -372,22 +375,36 @@ scoped_ptr<base::DictionaryValue> Printer::GetCapabilities() { |
return scoped_ptr<base::DictionaryValue>(dictionary_value->DeepCopy()); |
} |
-void Printer::CreateJob(const std::string& ticket) { |
- // TODO(maksymb): Implement advanced printing |
- NOTIMPLEMENTED(); |
+LocalPrintJob::CreateResult Printer::CreateJob(const std::string& ticket, |
+ std::string* job_id, |
+ int* expires_in, |
+ int* error_timeout, |
+ std::string* error_description) { |
+ return print_job_handler_->CreatePrintJob(ticket, job_id, expires_in, |
+ error_timeout, error_description); |
} |
LocalPrintJob::SaveResult Printer::SubmitDoc(const LocalPrintJob& job, |
std::string* job_id, |
+ int* expires_in, |
std::string* error_description, |
int* timeout) { |
- return print_job_handler_->SaveLocalPrintJob(job, job_id, error_description, |
- timeout); |
+ return print_job_handler_->SaveLocalPrintJob(job, job_id, expires_in, |
+ error_description, timeout); |
+} |
+ |
+LocalPrintJob::SaveResult Printer::SubmitDocWithId( |
+ const LocalPrintJob& job, |
+ const std::string& job_id, |
+ int* expires_in, |
+ std::string* error_description, |
+ int* timeout) { |
+ return print_job_handler_->CompleteLocalPrintJob(job, job_id, expires_in, |
+ error_description, timeout); |
} |
-void Printer::GetJobStatus(int job_id) { |
- // TODO(maksymb): Implement advanced printing |
- NOTIMPLEMENTED(); |
+bool Printer::GetJobState(const std::string& id, LocalPrintJob::Info* info) { |
+ return print_job_handler_->GetJobState(id, info); |
} |
void Printer::OnRegistrationStartResponseParsed( |