Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(528)

Unified Diff: printing/backend/print_backend_cups.cc

Issue 10399050: Adding functionality to specify TLS encryption CUPS print servers for cloudprint connector. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: printing/backend/print_backend_cups.cc
===================================================================
--- printing/backend/print_backend_cups.cc (revision 137176)
+++ printing/backend/print_backend_cups.cc (working copy)
@@ -102,7 +102,8 @@
class PrintBackendCUPS : public PrintBackend {
public:
- PrintBackendCUPS(const GURL& print_server_url, bool blocking);
+ PrintBackendCUPS(const GURL& print_server_url,
+ http_encryption_t encryption, bool blocking);
Ryan Sleevi 2012/05/17 00:35:27 style nit: put "bool blocking" on a new line, per
// PrintBackend implementation.
virtual bool EnumeratePrinters(PrinterList* printer_list) OVERRIDE;
@@ -126,11 +127,16 @@
FilePath GetPPD(const char* name);
GURL print_server_url_;
+ http_encryption_t cups_encryption_;
bool blocking_;
};
-PrintBackendCUPS::PrintBackendCUPS(const GURL& print_server_url, bool blocking)
- : print_server_url_(print_server_url), blocking_(blocking) {
+PrintBackendCUPS::PrintBackendCUPS(const GURL& print_server_url,
+ http_encryption_t encryption,
+ bool blocking)
+ : print_server_url_(print_server_url),
+ cups_encryption_(encryption),
+ blocking_(blocking) {
}
bool PrintBackendCUPS::EnumeratePrinters(PrinterList* printer_list) {
@@ -275,22 +281,27 @@
#endif
std::string print_server_url_str, cups_blocking;
+ int encryption = HTTP_ENCRYPT_NEVER;
if (print_backend_settings) {
print_backend_settings->GetString(kCUPSPrintServerURL,
&print_server_url_str);
print_backend_settings->GetString(kCUPSBlocking,
&cups_blocking);
+
+ print_backend_settings->GetInteger(kCUPSEncryption, &encryption);
}
GURL print_server_url(print_server_url_str.c_str());
- return new PrintBackendCUPS(print_server_url, cups_blocking == kValueTrue);
+ return new PrintBackendCUPS(print_server_url,
+ static_cast<http_encryption_t>(encryption),
+ cups_blocking == kValueTrue);
}
int PrintBackendCUPS::GetDests(cups_dest_t** dests) {
if (print_server_url_.is_empty()) { // Use default (local) print server.
return cupsGetDests(dests);
} else {
- HttpConnectionCUPS http(print_server_url_);
+ HttpConnectionCUPS http(print_server_url_, cups_encryption_);
http.SetBlocking(blocking_);
return cupsGetDests2(http.http(), dests);
}
@@ -314,7 +325,7 @@
// Note: After looking at CUPS sources, it looks like non-blocking
// connection will timeout after 10 seconds of no data period. And it will
// return the same way as if data was completely and sucessfully downloaded.
- HttpConnectionCUPS http(print_server_url_);
+ HttpConnectionCUPS http(print_server_url_, cups_encryption_);
http.SetBlocking(blocking_);
ppd_file_path = cupsGetPPD2(http.http(), name);
// Check if the get full PPD, since non-blocking call may simply return
« chrome/service/cloud_print/print_system_cups.cc ('K') | « printing/backend/print_backend_consts.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698