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_cups.h" | 5 #include "printing/backend/print_backend_cups.h" |
6 | 6 |
7 #include <cups/ppd.h> | 7 #include <cups/ppd.h> |
8 #include <dlfcn.h> | 8 #include <dlfcn.h> |
9 #include <errno.h> | 9 #include <errno.h> |
10 #include <pthread.h> | 10 #include <pthread.h> |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 int encryption = HTTP_ENCRYPT_NEVER; | 202 int encryption = HTTP_ENCRYPT_NEVER; |
203 if (print_backend_settings) { | 203 if (print_backend_settings) { |
204 print_backend_settings->GetString(kCUPSPrintServerURL, | 204 print_backend_settings->GetString(kCUPSPrintServerURL, |
205 &print_server_url_str); | 205 &print_server_url_str); |
206 | 206 |
207 print_backend_settings->GetString(kCUPSBlocking, | 207 print_backend_settings->GetString(kCUPSBlocking, |
208 &cups_blocking); | 208 &cups_blocking); |
209 | 209 |
210 print_backend_settings->GetInteger(kCUPSEncryption, &encryption); | 210 print_backend_settings->GetInteger(kCUPSEncryption, &encryption); |
211 } | 211 } |
212 GURL print_server_url(print_server_url_str.c_str()); | 212 GURL print_server_url(print_server_url_str); |
213 return new PrintBackendCUPS(print_server_url, | 213 return new PrintBackendCUPS(print_server_url, |
214 static_cast<http_encryption_t>(encryption), | 214 static_cast<http_encryption_t>(encryption), |
215 cups_blocking == kValueTrue); | 215 cups_blocking == kValueTrue); |
216 } | 216 } |
217 #endif // !defined(OS_CHROMEOS) | 217 #endif // !defined(OS_CHROMEOS) |
218 | 218 |
219 int PrintBackendCUPS::GetDests(cups_dest_t** dests) { | 219 int PrintBackendCUPS::GetDests(cups_dest_t** dests) { |
220 if (print_server_url_.is_empty()) { // Use default (local) print server. | 220 if (print_server_url_.is_empty()) { // Use default (local) print server. |
221 // GnuTLS has a genuine small memory leak that is easier to annotate | 221 // GnuTLS has a genuine small memory leak that is easier to annotate |
222 // than suppress. See http://crbug.com/176888#c7 | 222 // than suppress. See http://crbug.com/176888#c7 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 // Use default (local) print server. | 285 // Use default (local) print server. |
286 if (print_server_url_.is_empty()) | 286 if (print_server_url_.is_empty()) |
287 return cupsGetNamedDest(CUPS_HTTP_DEFAULT, printer_name.c_str(), nullptr); | 287 return cupsGetNamedDest(CUPS_HTTP_DEFAULT, printer_name.c_str(), nullptr); |
288 | 288 |
289 HttpConnectionCUPS http(print_server_url_, cups_encryption_); | 289 HttpConnectionCUPS http(print_server_url_, cups_encryption_); |
290 http.SetBlocking(blocking_); | 290 http.SetBlocking(blocking_); |
291 return cupsGetNamedDest(http.http(), printer_name.c_str(), nullptr); | 291 return cupsGetNamedDest(http.http(), printer_name.c_str(), nullptr); |
292 } | 292 } |
293 | 293 |
294 } // namespace printing | 294 } // namespace printing |
OLD | NEW |