Index: chrome/service/cloud_print/printer_job_handler.h |
diff --git a/chrome/service/cloud_print/printer_job_handler.h b/chrome/service/cloud_print/printer_job_handler.h |
index a818c839ecf581638d2ad1f76df5dbc49ee26cbd..f0939980ebc036d8f036d3cfc6a9abca1eedf28d 100644 |
--- a/chrome/service/cloud_print/printer_job_handler.h |
+++ b/chrome/service/cloud_print/printer_job_handler.h |
@@ -67,25 +67,6 @@ class PrinterJobHandler : public base::RefCountedThreadSafe<PrinterJobHandler>, |
public JobStatusUpdaterDelegate, |
public cloud_print::PrinterWatcherDelegate, |
public cloud_print::JobSpoolerDelegate { |
- enum PrintJobError { |
- SUCCESS, |
- JOB_DOWNLOAD_FAILED, |
- INVALID_JOB_DATA, |
- PRINT_FAILED, |
- }; |
- struct JobDetails { |
- JobDetails(); |
- ~JobDetails(); |
- void Clear(); |
- |
- std::string job_id_; |
- std::string job_title_; |
- std::string print_ticket_; |
- FilePath print_data_file_path_; |
- std::string print_data_mime_type_; |
- std::vector<std::string> tags_; |
- }; |
- |
public: |
class Delegate { |
public: |
@@ -110,14 +91,18 @@ class PrinterJobHandler : public base::RefCountedThreadSafe<PrinterJobHandler>, |
const GURL& cloud_print_server_url, |
cloud_print::PrintSystem* print_system, |
Delegate* delegate); |
- virtual ~PrinterJobHandler(); |
+ |
bool Initialize(); |
+ |
std::string GetPrinterName() const; |
+ |
// Requests a job check. |reason| is the reason for fetching the job. Used |
// for logging and diagnostc purposes. |
void CheckForJobs(const std::string& reason); |
+ |
// Shutdown everything (the process is exiting). |
void Shutdown(); |
+ |
base::TimeTicks last_job_fetch_time() const { return last_job_fetch_time_; } |
// End public interface |
@@ -162,6 +147,15 @@ class PrinterJobHandler : public base::RefCountedThreadSafe<PrinterJobHandler>, |
// End Delegate implementations |
private: |
+ friend class base::RefCountedThreadSafe<PrinterJobHandler>; |
+ |
+ enum PrintJobError { |
+ SUCCESS, |
+ JOB_DOWNLOAD_FAILED, |
+ INVALID_JOB_DATA, |
+ PRINT_FAILED, |
+ }; |
+ |
// Prototype for a JSON data handler. |
typedef CloudPrintURLFetcher::ResponseAction |
(PrinterJobHandler::*JSONDataHandler)(const content::URLFetcher* source, |
@@ -173,6 +167,22 @@ class PrinterJobHandler : public base::RefCountedThreadSafe<PrinterJobHandler>, |
(PrinterJobHandler::*DataHandler)(const content::URLFetcher* source, |
const GURL& url, |
const std::string& data); |
+ |
+ struct JobDetails { |
+ JobDetails(); |
+ ~JobDetails(); |
+ void Clear(); |
+ |
+ std::string job_id_; |
+ std::string job_title_; |
+ std::string print_ticket_; |
+ FilePath print_data_file_path_; |
+ std::string print_data_mime_type_; |
+ std::vector<std::string> tags_; |
+ }; |
+ |
+ virtual ~PrinterJobHandler(); |
+ |
// Begin request handlers for each state in the state machine |
CloudPrintURLFetcher::ResponseAction HandlePrinterUpdateResponse( |
const content::URLFetcher* source, |
@@ -219,7 +229,6 @@ class PrinterJobHandler : public base::RefCountedThreadSafe<PrinterJobHandler>, |
void Stop(); |
void StartPrinting(); |
- void HandleServerError(const GURL& url); |
void Reset(); |
void UpdateJobStatus(cloud_print::PrintJobStatus status, PrintJobError error); |