| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/service/cloud_print/print_system.h" | 5 #include "chrome/service/cloud_print/print_system.h" |
| 6 | 6 |
| 7 #include <cups/cups.h> | 7 #include <cups/cups.h> |
| 8 #include <dlfcn.h> | 8 #include <dlfcn.h> |
| 9 #include <errno.h> | 9 #include <errno.h> |
| 10 #include <pthread.h> | 10 #include <pthread.h> |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 base::Bind(&PrinterWatcherCUPS::PrinterUpdate, this), | 282 base::Bind(&PrinterWatcherCUPS::PrinterUpdate, this), |
| 283 print_system_->GetUpdateTimeout()); | 283 print_system_->GetUpdateTimeout()); |
| 284 return true; | 284 return true; |
| 285 } | 285 } |
| 286 | 286 |
| 287 virtual bool StopWatching() OVERRIDE{ | 287 virtual bool StopWatching() OVERRIDE{ |
| 288 delegate_ = NULL; | 288 delegate_ = NULL; |
| 289 return true; | 289 return true; |
| 290 } | 290 } |
| 291 | 291 |
| 292 bool GetCurrentPrinterInfo(printing::PrinterBasicInfo* printer_info) { | 292 virtual bool GetCurrentPrinterInfo( |
| 293 printing::PrinterBasicInfo* printer_info) OVERRIDE { |
| 293 DCHECK(printer_info); | 294 DCHECK(printer_info); |
| 294 return print_system_->GetPrinterInfo(printer_name_, printer_info); | 295 return print_system_->GetPrinterInfo(printer_name_, printer_info); |
| 295 } | 296 } |
| 296 | 297 |
| 297 void JobStatusUpdate() { | 298 void JobStatusUpdate() { |
| 298 if (delegate_ == NULL) | 299 if (delegate_ == NULL) |
| 299 return; // Orphan call. We have been stopped already. | 300 return; // Orphan call. We have been stopped already. |
| 300 // For CUPS proxy, we are going to fire OnJobChanged notification | 301 // For CUPS proxy, we are going to fire OnJobChanged notification |
| 301 // periodically. Higher level will check if there are any outstanding | 302 // periodically. Higher level will check if there are any outstanding |
| 302 // jobs for this printer and check their status. If printer has no | 303 // jobs for this printer and check their status. If printer has no |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 | 863 |
| 863 void PrintSystemCUPS::RunCapsCallback( | 864 void PrintSystemCUPS::RunCapsCallback( |
| 864 const PrinterCapsAndDefaultsCallback& callback, | 865 const PrinterCapsAndDefaultsCallback& callback, |
| 865 bool succeeded, | 866 bool succeeded, |
| 866 const std::string& printer_name, | 867 const std::string& printer_name, |
| 867 const printing::PrinterCapsAndDefaults& printer_info) { | 868 const printing::PrinterCapsAndDefaults& printer_info) { |
| 868 callback.Run(succeeded, printer_name, printer_info); | 869 callback.Run(succeeded, printer_name, printer_info); |
| 869 } | 870 } |
| 870 | 871 |
| 871 } // namespace cloud_print | 872 } // namespace cloud_print |
| OLD | NEW |