OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "printing/backend/print_backend_consts.h" | 9 #include "printing/backend/print_backend_consts.h" |
10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
11 | 11 |
12 #if defined(USE_CUPS) | 12 #if defined(USE_CUPS) |
13 #include "printing/backend/print_backend_cups.h" | 13 #include "printing/backend/print_backend_cups_ipp.h" |
14 #endif // defined(USE_CUPS) | 14 #endif // defined(USE_CUPS) |
15 | 15 |
16 namespace printing { | 16 namespace printing { |
17 | 17 |
18 // Provides a stubbed out PrintBackend implementation for use on ChromeOS. | 18 // Provides a stubbed out PrintBackend implementation for use on ChromeOS. |
Lei Zhang
2016/07/13 01:08:43
Update comment.
skau
2016/07/14 20:43:06
Done.
| |
19 class PrintBackendChromeOS : public PrintBackend { | 19 class PrintBackendChromeOS : public PrintBackend { |
20 public: | 20 public: |
21 PrintBackendChromeOS(); | 21 PrintBackendChromeOS(); |
22 | 22 |
23 // PrintBackend implementation. | 23 // PrintBackend implementation. |
24 bool EnumeratePrinters(PrinterList* printer_list) override; | 24 bool EnumeratePrinters(PrinterList* printer_list) override; |
25 std::string GetDefaultPrinterName() override; | 25 std::string GetDefaultPrinterName() override; |
26 bool GetPrinterBasicInfo(const std::string& printer_name, | 26 bool GetPrinterBasicInfo(const std::string& printer_name, |
27 PrinterBasicInfo* printer_info) override; | 27 PrinterBasicInfo* printer_info) override; |
28 bool GetPrinterSemanticCapsAndDefaults( | 28 bool GetPrinterSemanticCapsAndDefaults( |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 int encryption = HTTP_ENCRYPT_NEVER; | 86 int encryption = HTTP_ENCRYPT_NEVER; |
87 if (print_backend_settings) { | 87 if (print_backend_settings) { |
88 print_backend_settings->GetString(kCUPSPrintServerURL, | 88 print_backend_settings->GetString(kCUPSPrintServerURL, |
89 &print_server_url_str); | 89 &print_server_url_str); |
90 | 90 |
91 print_backend_settings->GetString(kCUPSBlocking, &cups_blocking); | 91 print_backend_settings->GetString(kCUPSBlocking, &cups_blocking); |
92 | 92 |
93 print_backend_settings->GetInteger(kCUPSEncryption, &encryption); | 93 print_backend_settings->GetInteger(kCUPSEncryption, &encryption); |
94 } | 94 } |
95 GURL print_server_url(print_server_url_str.c_str()); | 95 GURL print_server_url(print_server_url_str.c_str()); |
96 return new PrintBackendCUPS(print_server_url, | 96 |
97 static_cast<http_encryption_t>(encryption), | 97 CupsConnection connection(print_server_url, |
Lei Zhang
2016/07/13 01:08:43
This should be an unique_ptr, and PrintBackendCups
skau
2016/07/14 20:43:06
Thanks. I somehow missed that in the style guide.
| |
98 cups_blocking == kValueTrue); | 98 static_cast<http_encryption_t>(encryption), |
99 cups_blocking == kValueTrue); | |
100 | |
101 return new PrintBackendCupsIpp(std::move(connection)); | |
99 #endif // defined(USE_CUPS) | 102 #endif // defined(USE_CUPS) |
100 } | 103 } |
101 | 104 |
102 return new PrintBackendChromeOS(); | 105 return new PrintBackendChromeOS(); |
103 } | 106 } |
104 | 107 |
105 } // namespace printing | 108 } // namespace printing |
OLD | NEW |