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 "printing/backend/print_backend.h" | 5 #include "printing/backend/print_backend.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include <dlfcn.h> | 9 #include <dlfcn.h> |
10 #include <errno.h> | 10 #include <errno.h> |
(...skipping 16 matching lines...) Expand all Loading... |
27 static const char kCUPSPrinterStateOpt[] = "printer-state"; | 27 static const char kCUPSPrinterStateOpt[] = "printer-state"; |
28 static const char kCUPSPrinterTypeOpt[] = "printer-type"; | 28 static const char kCUPSPrinterTypeOpt[] = "printer-type"; |
29 static const char kCUPSPrinterMakeModelOpt[] = "printer-make-and-model"; | 29 static const char kCUPSPrinterMakeModelOpt[] = "printer-make-and-model"; |
30 | 30 |
31 class PrintBackendCUPS : public PrintBackend { | 31 class PrintBackendCUPS : public PrintBackend { |
32 public: | 32 public: |
33 PrintBackendCUPS(const GURL& print_server_url, | 33 PrintBackendCUPS(const GURL& print_server_url, |
34 http_encryption_t encryption, bool blocking); | 34 http_encryption_t encryption, bool blocking); |
35 | 35 |
36 // PrintBackend implementation. | 36 // PrintBackend implementation. |
37 virtual bool EnumeratePrinters(PrinterList* printer_list) override; | 37 bool EnumeratePrinters(PrinterList* printer_list) override; |
38 virtual std::string GetDefaultPrinterName() override; | 38 std::string GetDefaultPrinterName() override; |
39 virtual bool GetPrinterSemanticCapsAndDefaults( | 39 bool GetPrinterSemanticCapsAndDefaults( |
40 const std::string& printer_name, | 40 const std::string& printer_name, |
41 PrinterSemanticCapsAndDefaults* printer_info) override; | 41 PrinterSemanticCapsAndDefaults* printer_info) override; |
42 virtual bool GetPrinterCapsAndDefaults( | 42 bool GetPrinterCapsAndDefaults(const std::string& printer_name, |
43 const std::string& printer_name, | 43 PrinterCapsAndDefaults* printer_info) override; |
44 PrinterCapsAndDefaults* printer_info) override; | 44 std::string GetPrinterDriverInfo(const std::string& printer_name) override; |
45 virtual std::string GetPrinterDriverInfo( | 45 bool IsValidPrinter(const std::string& printer_name) override; |
46 const std::string& printer_name) override; | |
47 virtual bool IsValidPrinter(const std::string& printer_name) override; | |
48 | 46 |
49 protected: | 47 protected: |
50 virtual ~PrintBackendCUPS() {} | 48 ~PrintBackendCUPS() override {} |
51 | 49 |
52 private: | 50 private: |
53 // Following functions are wrappers around corresponding CUPS functions. | 51 // Following functions are wrappers around corresponding CUPS functions. |
54 // <functions>2() are called when print server is specified, and plain | 52 // <functions>2() are called when print server is specified, and plain |
55 // version in another case. There is an issue specifing CUPS_HTTP_DEFAULT | 53 // version in another case. There is an issue specifing CUPS_HTTP_DEFAULT |
56 // in the <functions>2(), it does not work in CUPS prior to 1.4. | 54 // in the <functions>2(), it does not work in CUPS prior to 1.4. |
57 int GetDests(cups_dest_t** dests); | 55 int GetDests(cups_dest_t** dests); |
58 base::FilePath GetPPD(const char* name); | 56 base::FilePath GetPPD(const char* name); |
59 | 57 |
60 GURL print_server_url_; | 58 GURL print_server_url_; |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 << ", HTTP error: " << http_error; | 295 << ", HTTP error: " << http_error; |
298 base::DeleteFile(ppd_path, false); | 296 base::DeleteFile(ppd_path, false); |
299 ppd_path.clear(); | 297 ppd_path.clear(); |
300 } | 298 } |
301 } | 299 } |
302 } | 300 } |
303 return ppd_path; | 301 return ppd_path; |
304 } | 302 } |
305 | 303 |
306 } // namespace printing | 304 } // namespace printing |
OLD | NEW |