| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_ | 5 #ifndef CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_ |
| 6 #define CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_ | 6 #define CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 // Begin Delegate implementations | 123 // Begin Delegate implementations |
| 124 | 124 |
| 125 // CloudPrintURLFetcher::Delegate implementation. | 125 // CloudPrintURLFetcher::Delegate implementation. |
| 126 virtual CloudPrintURLFetcher::ResponseAction HandleRawResponse( | 126 virtual CloudPrintURLFetcher::ResponseAction HandleRawResponse( |
| 127 const content::URLFetcher* source, | 127 const content::URLFetcher* source, |
| 128 const GURL& url, | 128 const GURL& url, |
| 129 const net::URLRequestStatus& status, | 129 const net::URLRequestStatus& status, |
| 130 int response_code, | 130 int response_code, |
| 131 const net::ResponseCookies& cookies, | 131 const net::ResponseCookies& cookies, |
| 132 const std::string& data); | 132 const std::string& data) OVERRIDE; |
| 133 virtual CloudPrintURLFetcher::ResponseAction HandleRawData( | 133 virtual CloudPrintURLFetcher::ResponseAction HandleRawData( |
| 134 const content::URLFetcher* source, | 134 const content::URLFetcher* source, |
| 135 const GURL& url, | 135 const GURL& url, |
| 136 const std::string& data); | 136 const std::string& data) OVERRIDE; |
| 137 virtual CloudPrintURLFetcher::ResponseAction HandleJSONData( | 137 virtual CloudPrintURLFetcher::ResponseAction HandleJSONData( |
| 138 const content::URLFetcher* source, | 138 const content::URLFetcher* source, |
| 139 const GURL& url, | 139 const GURL& url, |
| 140 base::DictionaryValue* json_data, | 140 base::DictionaryValue* json_data, |
| 141 bool succeeded); | 141 bool succeeded) OVERRIDE; |
| 142 virtual void OnRequestGiveUp(); | 142 virtual void OnRequestGiveUp() OVERRIDE; |
| 143 virtual CloudPrintURLFetcher::ResponseAction OnRequestAuthError(); | 143 virtual CloudPrintURLFetcher::ResponseAction OnRequestAuthError() OVERRIDE; |
| 144 virtual std::string GetAuthHeader(); | 144 virtual std::string GetAuthHeader() OVERRIDE; |
| 145 | 145 |
| 146 // JobStatusUpdater::Delegate implementation | 146 // JobStatusUpdater::Delegate implementation |
| 147 virtual bool OnJobCompleted(JobStatusUpdater* updater); | 147 virtual bool OnJobCompleted(JobStatusUpdater* updater) OVERRIDE; |
| 148 virtual void OnAuthError(); | 148 virtual void OnAuthError() OVERRIDE; |
| 149 | 149 |
| 150 // cloud_print::PrinterWatcherDelegate implementation | 150 // cloud_print::PrinterWatcherDelegate implementation |
| 151 virtual void OnPrinterDeleted(); | 151 virtual void OnPrinterDeleted() OVERRIDE; |
| 152 virtual void OnPrinterChanged(); | 152 virtual void OnPrinterChanged() OVERRIDE; |
| 153 virtual void OnJobChanged(); | 153 virtual void OnJobChanged() OVERRIDE; |
| 154 | 154 |
| 155 // cloud_print::JobSpoolerDelegate implementation. | 155 // cloud_print::JobSpoolerDelegate implementation. |
| 156 // Called on print_thread_. | 156 // Called on print_thread_. |
| 157 virtual void OnJobSpoolSucceeded(const cloud_print::PlatformJobId& job_id); | 157 virtual void OnJobSpoolSucceeded( |
| 158 virtual void OnJobSpoolFailed(); | 158 const cloud_print::PlatformJobId& job_id) OVERRIDE; |
| 159 virtual void OnJobSpoolFailed() OVERRIDE; |
| 159 | 160 |
| 160 // End Delegate implementations | 161 // End Delegate implementations |
| 161 | 162 |
| 162 private: | 163 private: |
| 163 // Prototype for a JSON data handler. | 164 // Prototype for a JSON data handler. |
| 164 typedef CloudPrintURLFetcher::ResponseAction | 165 typedef CloudPrintURLFetcher::ResponseAction |
| 165 (PrinterJobHandler::*JSONDataHandler)(const content::URLFetcher* source, | 166 (PrinterJobHandler::*JSONDataHandler)(const content::URLFetcher* source, |
| 166 const GURL& url, | 167 const GURL& url, |
| 167 base::DictionaryValue* json_data, | 168 base::DictionaryValue* json_data, |
| 168 bool succeeded); | 169 bool succeeded); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 DISALLOW_COPY_AND_ASSIGN(PrinterJobHandler); | 293 DISALLOW_COPY_AND_ASSIGN(PrinterJobHandler); |
| 293 }; | 294 }; |
| 294 | 295 |
| 295 // This typedef is to workaround the issue with certain versions of | 296 // This typedef is to workaround the issue with certain versions of |
| 296 // Visual Studio where it gets confused between multiple Delegate | 297 // Visual Studio where it gets confused between multiple Delegate |
| 297 // classes and gives a C2500 error. (I saw this error on the try bots - | 298 // classes and gives a C2500 error. (I saw this error on the try bots - |
| 298 // the workaround was not needed for my machine). | 299 // the workaround was not needed for my machine). |
| 299 typedef PrinterJobHandler::Delegate PrinterJobHandlerDelegate; | 300 typedef PrinterJobHandler::Delegate PrinterJobHandlerDelegate; |
| 300 | 301 |
| 301 #endif // CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_ | 302 #endif // CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_ |
| OLD | NEW |