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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 const std::string& printer_name, | 89 const std::string& printer_name, |
90 const std::string& print_ticket_data, | 90 const std::string& print_ticket_data, |
91 const std::string& print_ticket_mime_type) OVERRIDE; | 91 const std::string& print_ticket_mime_type) OVERRIDE; |
92 virtual bool GetJobDetails(const std::string& printer_name, | 92 virtual bool GetJobDetails(const std::string& printer_name, |
93 PlatformJobId job_id, | 93 PlatformJobId job_id, |
94 PrintJobDetails *job_details) OVERRIDE; | 94 PrintJobDetails *job_details) OVERRIDE; |
95 virtual PrintSystem::PrintServerWatcher* CreatePrintServerWatcher() OVERRIDE; | 95 virtual PrintSystem::PrintServerWatcher* CreatePrintServerWatcher() OVERRIDE; |
96 virtual PrintSystem::PrinterWatcher* CreatePrinterWatcher( | 96 virtual PrintSystem::PrinterWatcher* CreatePrinterWatcher( |
97 const std::string& printer_name) OVERRIDE; | 97 const std::string& printer_name) OVERRIDE; |
98 virtual PrintSystem::JobSpooler* CreateJobSpooler() OVERRIDE; | 98 virtual PrintSystem::JobSpooler* CreateJobSpooler() OVERRIDE; |
| 99 virtual bool UseCddAndCjt() OVERRIDE; |
99 virtual std::string GetSupportedMimeTypes() OVERRIDE; | 100 virtual std::string GetSupportedMimeTypes() OVERRIDE; |
100 | 101 |
101 // Helper functions. | 102 // Helper functions. |
102 PlatformJobId SpoolPrintJob(const std::string& print_ticket, | 103 PlatformJobId SpoolPrintJob(const std::string& print_ticket, |
103 const base::FilePath& print_data_file_path, | 104 const base::FilePath& print_data_file_path, |
104 const std::string& print_data_mime_type, | 105 const std::string& print_data_mime_type, |
105 const std::string& printer_name, | 106 const std::string& printer_name, |
106 const std::string& job_title, | 107 const std::string& job_title, |
107 const std::vector<std::string>& tags, | 108 const std::vector<std::string>& tags, |
108 bool* dry_run); | 109 bool* dry_run); |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 DCHECK(initialized_); | 722 DCHECK(initialized_); |
722 DCHECK(!printer_name.empty()); | 723 DCHECK(!printer_name.empty()); |
723 return new PrinterWatcherCUPS(this, printer_name); | 724 return new PrinterWatcherCUPS(this, printer_name); |
724 } | 725 } |
725 | 726 |
726 PrintSystem::JobSpooler* PrintSystemCUPS::CreateJobSpooler() { | 727 PrintSystem::JobSpooler* PrintSystemCUPS::CreateJobSpooler() { |
727 DCHECK(initialized_); | 728 DCHECK(initialized_); |
728 return new JobSpoolerCUPS(this); | 729 return new JobSpoolerCUPS(this); |
729 } | 730 } |
730 | 731 |
| 732 bool PrintSystemCUPS::UseCddAndCjt() { |
| 733 return false; |
| 734 } |
| 735 |
731 std::string PrintSystemCUPS::GetSupportedMimeTypes() { | 736 std::string PrintSystemCUPS::GetSupportedMimeTypes() { |
732 return supported_mime_types_; | 737 return supported_mime_types_; |
733 } | 738 } |
734 | 739 |
735 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( | 740 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( |
736 const base::DictionaryValue* print_system_settings) { | 741 const base::DictionaryValue* print_system_settings) { |
737 return new PrintSystemCUPS(print_system_settings); | 742 return new PrintSystemCUPS(print_system_settings); |
738 } | 743 } |
739 | 744 |
740 int PrintSystemCUPS::PrintFile(const GURL& url, http_encryption_t encryption, | 745 int PrintSystemCUPS::PrintFile(const GURL& url, http_encryption_t encryption, |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 | 874 |
870 void PrintSystemCUPS::RunCapsCallback( | 875 void PrintSystemCUPS::RunCapsCallback( |
871 const PrinterCapsAndDefaultsCallback& callback, | 876 const PrinterCapsAndDefaultsCallback& callback, |
872 bool succeeded, | 877 bool succeeded, |
873 const std::string& printer_name, | 878 const std::string& printer_name, |
874 const printing::PrinterCapsAndDefaults& printer_info) { | 879 const printing::PrinterCapsAndDefaults& printer_info) { |
875 callback.Run(succeeded, printer_name, printer_info); | 880 callback.Run(succeeded, printer_name, printer_info); |
876 } | 881 } |
877 | 882 |
878 } // namespace cloud_print | 883 } // namespace cloud_print |
OLD | NEW |