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

Unified Diff: printing/backend/print_backend_chromeos.cc

Issue 1934013002: Enable the cups backend when --enable-native-cups is specified. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cupsFlag
Patch Set: Select the printing backends at runtime via --enable-native-cups Created 4 years, 6 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
« no previous file with comments | « printing/backend/print_backend.cc ('k') | printing/backend/print_backend_cups.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/backend/print_backend_chromeos.cc
diff --git a/printing/backend/print_backend_chromeos.cc b/printing/backend/print_backend_chromeos.cc
index f32bbe1e865cd28656aaa9bc65550af4c7f0a173..35f51b7ec6085e53069e76f3ad61971fe4009a1a 100644
--- a/printing/backend/print_backend_chromeos.cc
+++ b/printing/backend/print_backend_chromeos.cc
@@ -5,6 +5,13 @@
#include "printing/backend/print_backend.h"
#include "base/logging.h"
+#include "base/values.h"
+#include "printing/backend/print_backend_consts.h"
+#include "url/gurl.h"
+
+#if defined(USE_CUPS)
+#include "printing/backend/print_backend_cups.h"
+#endif // defined(USE_CUPS)
namespace printing {
@@ -72,8 +79,27 @@ bool PrintBackendChromeOS::IsValidPrinter(const std::string& printer_name) {
scoped_refptr<PrintBackend> PrintBackend::CreateInstance(
const base::DictionaryValue* print_backend_settings) {
+ if (GetNativeCupsEnabled()) {
+#if defined(USE_CUPS)
+ std::string print_server_url_str;
+ std::string 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,
+ static_cast<http_encryption_t>(encryption),
+ cups_blocking == kValueTrue);
+#endif // defined(USE_CUPS)
+ }
+
return new PrintBackendChromeOS();
}
} // namespace printing
-
« no previous file with comments | « printing/backend/print_backend.cc ('k') | printing/backend/print_backend_cups.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698