OLD | NEW |
1 // Copyright 2016 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" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 std::string cups_blocking; | 88 std::string cups_blocking; |
89 int encryption = HTTP_ENCRYPT_NEVER; | 89 int encryption = HTTP_ENCRYPT_NEVER; |
90 if (print_backend_settings) { | 90 if (print_backend_settings) { |
91 print_backend_settings->GetString(kCUPSPrintServerURL, | 91 print_backend_settings->GetString(kCUPSPrintServerURL, |
92 &print_server_url_str); | 92 &print_server_url_str); |
93 | 93 |
94 print_backend_settings->GetString(kCUPSBlocking, &cups_blocking); | 94 print_backend_settings->GetString(kCUPSBlocking, &cups_blocking); |
95 | 95 |
96 print_backend_settings->GetInteger(kCUPSEncryption, &encryption); | 96 print_backend_settings->GetInteger(kCUPSEncryption, &encryption); |
97 } | 97 } |
98 GURL print_server_url(print_server_url_str.c_str()); | 98 GURL print_server_url(print_server_url_str); |
99 | 99 |
100 std::unique_ptr<CupsConnection> connection = | 100 std::unique_ptr<CupsConnection> connection = |
101 base::MakeUnique<CupsConnection>( | 101 base::MakeUnique<CupsConnection>( |
102 print_server_url, static_cast<http_encryption_t>(encryption), | 102 print_server_url, static_cast<http_encryption_t>(encryption), |
103 cups_blocking == kValueTrue); | 103 cups_blocking == kValueTrue); |
104 | 104 |
105 return new PrintBackendCupsIpp(std::move(connection)); | 105 return new PrintBackendCupsIpp(std::move(connection)); |
106 #endif // defined(USE_CUPS) | 106 #endif // defined(USE_CUPS) |
107 } | 107 } |
108 | 108 |
109 return new PrintBackendChromeOS(); | 109 return new PrintBackendChromeOS(); |
110 } | 110 } |
111 | 111 |
112 } // namespace printing | 112 } // namespace printing |
OLD | NEW |