chromium/chrome/services/printing/public/mojom/printing_service.mojom

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module printing.mojom;

import "chrome/services/printing/public/mojom/pdf_nup_converter.mojom";
import "chrome/services/printing/public/mojom/pdf_to_pwg_raster_converter.mojom";
import "sandbox/policy/mojom/sandbox.mojom";

[EnableIf=is_chromeos]
import "chrome/services/printing/public/mojom/pdf_flattener.mojom";

[EnableIf=is_win]
import "chrome/services/printing/public/mojom/pdf_to_emf_converter.mojom";

// The different sandbox on Windows allows the service to know it should
// patch certain GDI functions prior to service startup.
[EnableIf=is_win]
const sandbox.mojom.Sandbox kPrintingServiceSandbox
  = sandbox.mojom.Sandbox.kPdfConversion;
[EnableIfNot=is_win]
const sandbox.mojom.Sandbox kPrintingServiceSandbox
  = sandbox.mojom.Sandbox.kUtility;

// The main interface to Chrome's Printing Service, which performs various
// conversion operations in an isolated sandboxed process. These operations
// commonly involve working with PDFs.
[ServiceSandbox=kPrintingServiceSandbox]
interface PrintingService {
  // Binds an interface that can be used to do Nup PDF conversion.
  [EnableIf=enable_print_preview]
  BindPdfNupConverter(pending_receiver<PdfNupConverter> receiver);

  // Binds an interface that can be used to do PDF to PWG Raster conversion.
  [EnableIf=enable_print_preview]
  BindPdfToPwgRasterConverter(
      pending_receiver<PdfToPwgRasterConverter> receiver);

  // Binds an interface that can be used to flatten a PDF.
  [EnableIf=is_chromeos]
  BindPdfFlattener(pending_receiver<PdfFlattener> receiver);

  // Binds an interface that can be used to do PDF to EMF conversion. Windows
  // only.
  [EnableIf=is_win]
  BindPdfToEmfConverterFactory(
      pending_receiver<PdfToEmfConverterFactory> receiver);
};