Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 module printing.mojom; | |
| 6 | |
| 7 import "mojo/common/string16.mojom"; | |
| 8 | |
| 9 [Native] | |
| 10 struct PwgRasterSettings; | |
| 11 | |
| 12 [Native] | |
| 13 struct PrinterCapsAndDefaults; | |
| 14 | |
| 15 [Native] | |
| 16 struct PrinterSemanticCapsAndDefaults; | |
| 17 | |
| 18 [Native] | |
| 19 struct LOGFONT; // Windows-only | |
| 20 | |
| 21 [Native] | |
| 22 struct PdfRenderSettings; | |
| 23 | |
| 24 // Called by the utility process to have the browser do font pre-caching. | |
| 25 interface FontPreCaching { | |
| 26 // Windows-only: | |
| 27 | |
| 28 // Request that the given font characters be loaded by the browser so it's | |
| 29 // cached by the OS. Please see | |
| 30 // PdfToEmfUtilityProcessHostClient::OnPreCacheFontCharacters for details. | |
| 31 [Sync] | |
| 32 PreCacheFontCharacters(LOGFONT font_data, | |
| 33 mojo.common.mojom.String16 characters) => (); | |
| 34 }; | |
| 35 | |
| 36 // These are messages from the browser to the utility process. | |
| 37 interface Printing { | |
| 38 // Tell the utility process to render the given PDF into a PWGRaster. Returns | |
| 39 // whether the rendering the PDF to PWG succeeded or not. | |
| 40 RenderPDFPagesToPWGRaster( | |
| 41 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.
| |
| 42 PdfRenderSettings settings, | |
| 43 PwgRasterSettings bitmap_settings, | |
| 44 handle output_pwg_file) => (bool success); | |
| 45 | |
| 46 // Tells the utility process to get capabilities and defaults for the | |
| 47 // specified printer. Used on Windows to isolate the service process from | |
| 48 // printer driver crashes by executing this in a separate process. This does | |
| 49 // not run in a sandbox. If the method fails |caps_and_defaults| will be null. | |
| 50 GetPrinterCapsAndDefaults(string printer_name) => | |
| 51 (PrinterCapsAndDefaults? caps_and_defaults); | |
| 52 | |
| 53 // Tells the utility process to get capabilities and defaults for the | |
| 54 // specified printer. Used on Windows to isolate the service process from | |
| 55 // printer driver crashes by executing this in a separate process. This does | |
| 56 // not run in a sandbox. Returns result as | |
| 57 // printing::PrinterSemanticCapsAndDefaults. If the method fails | |
| 58 // |caps_and_defaults| will be null. | |
| 59 GetPrinterSemanticCapsAndDefaults(string printer_name) => | |
| 60 (PrinterSemanticCapsAndDefaults? caps_and_defaults); | |
| 61 | |
| 62 // Windows-only: | |
| 63 | |
| 64 // Tell the utility process to start rendering the given PDF into a | |
| 65 // metafile. |page_count| is 0, if loading failed. Utility process would be | |
| 66 // alive until RenderPDFPagesToMetafiles_Stop is called. | |
| 67 // | |
| 68 // TODO(tibell): Use a null |page_count| for failure. | |
| 69 RenderPDFPagesToMetafiles( | |
| 70 handle input_file, | |
| 71 PdfRenderSettings settings, | |
| 72 bool print_text_with_gdi) => (int32 page_count); | |
| 73 | |
| 74 // Requests conversion of the next page. | |
| 75 RenderPDFPagesToMetafilesGetPage(int32 page_number, handle output_file) => | |
| 76 (bool success, float scale_factor); | |
| 77 | |
| 78 // Requests utility process to stop conversion and exit. | |
| 79 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.
| |
| 80 }; | |
| 81 | |
| 82 // Create a printing interface. This is done using a factory so we can pass a | |
| 83 // |FontPreCaching| callback interface to the receiver side before any of the | |
| 84 // methods on |Printing| are called. | |
| 85 interface PrintingFactory { | |
| 86 // Creates a new connection using the |printing| pipe. | |
| 87 MakePrinting(Printing& printing, FontPreCaching? font_pre_caching); | |
| 88 }; | |
| OLD | NEW |