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

Unified Diff: components/printing/common/printing.mojom

Issue 2477283002: Convert printing IPCs to Mojo
Patch Set: Fix more Windows compile errors Created 3 years, 11 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
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..696a352c888b05e5ac1ba145de0c9abea849f252
--- /dev/null
+++ b/components/printing/common/printing.mojom
@@ -0,0 +1,85 @@
+// Copyright 2017 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/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.
+ 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);
+};

Powered by Google App Engine
This is Rietveld 408576698