Chromium Code Reviews| 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. |
| 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. |
| (...skipping 62 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 |
|
Lei Zhang
2016/07/08 01:19:50
Do you want to exclude building PrintBackendCUPS o
skau
2016/07/08 21:24:08
I'm doing it with the BUILD file. Should the file
| |
| 97 static_cast<http_encryption_t>(encryption), | 97 CupsConnection connection(print_server_url, |
| 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 |