Chromium Code Reviews| Index: components/printing/common/printing.mojom |
| diff --git a/components/printing/common/printing.mojom b/components/printing/common/printing.mojom |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..264a726b1c2d5cdea89c6c9d6d8d1f52395b47dc |
| --- /dev/null |
| +++ b/components/printing/common/printing.mojom |
| @@ -0,0 +1,87 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
|
Sam McNally
2017/01/05 06:23:15
Happy new year!
tibell
2017/01/12 03:30:15
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +module printing.mojom; |
| + |
| +import "mojo/common/file.mojom"; |
| +import "mojo/common/string16.mojom"; |
| + |
| +[Native] |
| +struct PwgRasterSettings; |
| + |
| +[Native] |
| +struct PrinterCapsAndDefaults; |
| + |
| +[Native] |
| +struct PrinterSemanticCapsAndDefaults; |
| + |
| +[Native] |
| +struct LOGFONT; // Windows-only |
| + |
| +[Native] |
| +struct PdfRenderSettings; |
| + |
| +// Called by the utility process to have the browser do font pre-caching. |
| +interface FontPreCaching { |
| + // Windows-only: |
| + |
| + // Request that the given font characters be loaded by the browser so it's |
| + // cached by the OS. Please see |
| + // PdfToEmfUtilityProcessHostClient::OnPreCacheFontCharacters for details. |
| + [Sync] |
| + PreCacheFontCharacters(LOGFONT font_data, |
| + mojo.common.mojom.String16 characters) => (); |
| +}; |
| + |
| +// These are messages from the browser to the utility process. |
| +interface Printing { |
| + // Tell the utility process to render the given PDF into a PWGRaster. Returns |
| + // whether the rendering the PDF to PWG succeeded or not. |
| + RenderPDFPagesToPWGRaster( |
| + mojo.common.mojom.File input_pdf_file, |
| + PdfRenderSettings settings, |
| + PwgRasterSettings bitmap_settings, |
| + mojo.common.mojom.File output_pwg_file) => (bool success); |
| + |
| + // Tells the utility process to get capabilities and defaults for the |
| + // specified printer. Used on Windows to isolate the service process from |
| + // printer driver crashes by executing this in a separate process. This does |
| + // not run in a sandbox. If the method fails |caps_and_defaults| will be null. |
| + GetPrinterCapsAndDefaults(string printer_name) => |
| + (PrinterCapsAndDefaults? caps_and_defaults); |
| + |
| + // Tells the utility process to get capabilities and defaults for the |
| + // specified printer. Used on Windows to isolate the service process from |
| + // printer driver crashes by executing this in a separate process. This does |
| + // not run in a sandbox. Returns result as |
| + // printing::PrinterSemanticCapsAndDefaults. If the method fails |
| + // |caps_and_defaults| will be null. |
| + GetPrinterSemanticCapsAndDefaults(string printer_name) => |
| + (PrinterSemanticCapsAndDefaults? caps_and_defaults); |
| + |
| + // Windows-only: |
| + |
| + // Tell the utility process to start rendering the given PDF into a |
| + // metafile. |page_count| is 0, if loading failed. Utility process would be |
| + // alive until RenderPDFPagesToMetafiles_Stop is called. |
| + // |
| + // TODO(tibell): Use a null |page_count| for failure. |
|
Sam McNally
2017/01/05 06:23:15
I don't think primitive types are nullable.
tibell
2017/01/12 03:30:15
Done.
|
| + RenderPDFPagesToMetafiles( |
| + mojo.common.mojom.File input_file, |
| + PdfRenderSettings settings, |
| + bool print_text_with_gdi) => (int32 page_count); |
| + |
| + // Requests conversion of the next page. |
| + RenderPDFPagesToMetafilesGetPage(int32 page_number, |
| + mojo.common.mojom.File output_file) => |
| + (bool success, float scale_factor); |
| +}; |
| + |
| +// Create a printing interface. This is done using a factory so we can pass a |
| +// |FontPreCaching| callback interface to the receiver side before any of the |
| +// methods on |Printing| are called. |
| +interface PrintingFactory { |
| + // Creates a new connection using the |printing| pipe. |
| + MakePrinting(Printing& printing, FontPreCaching? font_pre_caching); |
| +}; |