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 virtual bool EnumeratePrinters(PrinterList* printer_list) override; |
38 virtual std::string GetDefaultPrinterName() OVERRIDE; | 38 virtual std::string GetDefaultPrinterName() override; |
39 virtual bool GetPrinterSemanticCapsAndDefaults( | 39 virtual 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 virtual bool GetPrinterCapsAndDefaults( |
43 const std::string& printer_name, | 43 const std::string& printer_name, |
44 PrinterCapsAndDefaults* printer_info) OVERRIDE; | 44 PrinterCapsAndDefaults* printer_info) override; |
45 virtual std::string GetPrinterDriverInfo( | 45 virtual std::string GetPrinterDriverInfo( |
46 const std::string& printer_name) OVERRIDE; | 46 const std::string& printer_name) override; |
47 virtual bool IsValidPrinter(const std::string& printer_name) OVERRIDE; | 47 virtual bool IsValidPrinter(const std::string& printer_name) override; |
48 | 48 |
49 protected: | 49 protected: |
50 virtual ~PrintBackendCUPS() {} | 50 virtual ~PrintBackendCUPS() {} |
51 | 51 |
52 private: | 52 private: |
53 // Following functions are wrappers around corresponding CUPS functions. | 53 // Following functions are wrappers around corresponding CUPS functions. |
54 // <functions>2() are called when print server is specified, and plain | 54 // <functions>2() are called when print server is specified, and plain |
55 // version in another case. There is an issue specifing CUPS_HTTP_DEFAULT | 55 // 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. | 56 // in the <functions>2(), it does not work in CUPS prior to 1.4. |
57 int GetDests(cups_dest_t** dests); | 57 int GetDests(cups_dest_t** dests); |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 << ", HTTP error: " << http_error; | 297 << ", HTTP error: " << http_error; |
298 base::DeleteFile(ppd_path, false); | 298 base::DeleteFile(ppd_path, false); |
299 ppd_path.clear(); | 299 ppd_path.clear(); |
300 } | 300 } |
301 } | 301 } |
302 } | 302 } |
303 return ppd_path; | 303 return ppd_path; |
304 } | 304 } |
305 | 305 |
306 } // namespace printing | 306 } // namespace printing |
OLD | NEW |