[go: nahoru, domu]

Transfer system print dialog settings to Print Backend service

Linux and macOS platforms are not yet able to display the system print
dialog from the Print Backend service.  In these cases the dialog is
still invoked from the browser process.  This requires that the user
settings specified must be collected and then transferred to the
Print Backend service so that the rest of the print pipeline can still
be performed out-of-process.

The nature of such data is platform specific.  Encapsulate the data
in a dictionary value for transfer to the service.  Mojom validation
ensures that the data passes at least basic expectations for the number
and type of entries in the dictionary.

Test: System print (Print Preview and direct) for both Linux and macOS
Low-Coverage-Reason: https://crbug.com/1451540, https://crbug.com/1463045
Bug: 1477394
Change-Id: Id09823f10362f9aa00867d3d5cc10fc9706d56e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4827824
Reviewed-by: Jayson Adams <shrike@chromium.org>
Commit-Queue: Alan Screen <awscreen@chromium.org>
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Andy Phan <andyphan@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1191626}
diff --git a/chrome/services/printing/print_backend_service_impl.cc b/chrome/services/printing/print_backend_service_impl.cc
index 23cc3d31..5acbc12b 100644
--- a/chrome/services/printing/print_backend_service_impl.cc
+++ b/chrome/services/printing/print_backend_service_impl.cc
@@ -749,7 +749,7 @@
 #if !BUILDFLAG(ENABLE_OOP_BASIC_PRINT_DIALOG)
   if (settings) {
     // Apply the settings from the in-browser system dialog to the context.
-    context_container->context->ApplyPrintSettings(*settings);
+    context_container->context->SetPrintSettings(*settings);
   }
 #endif