| 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_JOB_STATUS_UPDATER_H_ | 5 #ifndef CHROME_SERVICE_CLOUD_PRINT_JOB_STATUS_UPDATER_H_ |
| 6 #define CHROME_SERVICE_CLOUD_PRINT_JOB_STATUS_UPDATER_H_ | 6 #define CHROME_SERVICE_CLOUD_PRINT_JOB_STATUS_UPDATER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 // Checks the status of the local print job and sends an update. | 43 // Checks the status of the local print job and sends an update. |
| 44 void UpdateStatus(); | 44 void UpdateStatus(); |
| 45 void Stop(); | 45 void Stop(); |
| 46 | 46 |
| 47 // CloudPrintURLFetcher::Delegate implementation. | 47 // CloudPrintURLFetcher::Delegate implementation. |
| 48 virtual CloudPrintURLFetcher::ResponseAction HandleJSONData( | 48 virtual CloudPrintURLFetcher::ResponseAction HandleJSONData( |
| 49 const content::URLFetcher* source, | 49 const content::URLFetcher* source, |
| 50 const GURL& url, | 50 const GURL& url, |
| 51 base::DictionaryValue* json_data, | 51 base::DictionaryValue* json_data, |
| 52 bool succeeded); | 52 bool succeeded) OVERRIDE; |
| 53 virtual CloudPrintURLFetcher::ResponseAction OnRequestAuthError(); | 53 virtual CloudPrintURLFetcher::ResponseAction OnRequestAuthError() OVERRIDE; |
| 54 virtual std::string GetAuthHeader(); | 54 virtual std::string GetAuthHeader() OVERRIDE; |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 std::string printer_name_; | 57 std::string printer_name_; |
| 58 std::string job_id_; | 58 std::string job_id_; |
| 59 cloud_print::PlatformJobId local_job_id_; | 59 cloud_print::PlatformJobId local_job_id_; |
| 60 cloud_print::PrintJobDetails last_job_details_; | 60 cloud_print::PrintJobDetails last_job_details_; |
| 61 scoped_refptr<CloudPrintURLFetcher> request_; | 61 scoped_refptr<CloudPrintURLFetcher> request_; |
| 62 GURL cloud_print_server_url_; | 62 GURL cloud_print_server_url_; |
| 63 scoped_refptr<cloud_print::PrintSystem> print_system_; | 63 scoped_refptr<cloud_print::PrintSystem> print_system_; |
| 64 Delegate* delegate_; | 64 Delegate* delegate_; |
| 65 // A flag that is set to true in Stop() and will ensure the next scheduled | 65 // A flag that is set to true in Stop() and will ensure the next scheduled |
| 66 // task will do nothing. | 66 // task will do nothing. |
| 67 bool stopped_; | 67 bool stopped_; |
| 68 DISALLOW_COPY_AND_ASSIGN(JobStatusUpdater); | 68 DISALLOW_COPY_AND_ASSIGN(JobStatusUpdater); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 // This typedef is to workaround the issue with certain versions of | 71 // This typedef is to workaround the issue with certain versions of |
| 72 // Visual Studio where it gets confused between multiple Delegate | 72 // Visual Studio where it gets confused between multiple Delegate |
| 73 // classes and gives a C2500 error. (I saw this error on the try bots - | 73 // classes and gives a C2500 error. (I saw this error on the try bots - |
| 74 // the workaround was not needed for my machine). | 74 // the workaround was not needed for my machine). |
| 75 typedef JobStatusUpdater::Delegate JobStatusUpdaterDelegate; | 75 typedef JobStatusUpdater::Delegate JobStatusUpdaterDelegate; |
| 76 | 76 |
| 77 #endif // CHROME_SERVICE_CLOUD_PRINT_JOB_STATUS_UPDATER_H_ | 77 #endif // CHROME_SERVICE_CLOUD_PRINT_JOB_STATUS_UPDATER_H_ |
| OLD | NEW |