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..143b87476f2df2356d6794751c39bcd43aa411b4 |
--- /dev/null |
+++ b/components/printing/common/printing.mojom |
@@ -0,0 +1,88 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// 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/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( |
+ handle input_pdf_file, |
Sam McNally
2016/12/12 06:09:20
Use mojo.common.mojom.File for passing files aroun
tibell
2016/12/13 23:41:55
Done.
|
+ PdfRenderSettings settings, |
+ PwgRasterSettings bitmap_settings, |
+ handle 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. |
+ RenderPDFPagesToMetafiles( |
+ handle input_file, |
+ PdfRenderSettings settings, |
+ bool print_text_with_gdi) => (int32 page_count); |
+ |
+ // Requests conversion of the next page. |
+ RenderPDFPagesToMetafilesGetPage(int32 page_number, handle output_file) => |
+ (bool success, float scale_factor); |
+ |
+ // Requests utility process to stop conversion and exit. |
+ RenderPDFPagesToMetafilesStop(); |
Sam McNally
2016/12/12 06:09:20
Why not use the closing of the connection to indic
tibell
2016/12/13 23:41:55
Done.
|
+}; |
+ |
+// 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); |
+}; |