diff options
Diffstat (limited to 'chromium/components/printing/common/print.mojom')
-rw-r--r-- | chromium/components/printing/common/print.mojom | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/chromium/components/printing/common/print.mojom b/chromium/components/printing/common/print.mojom index 408f5bc1e43..faccd2a6881 100644 --- a/chromium/components/printing/common/print.mojom +++ b/chromium/components/printing/common/print.mojom @@ -29,6 +29,32 @@ struct OptionsFromDocumentParams { DuplexMode duplex; }; +// Holds the printed content information. +// The printed content is in shared memory, and passed as a region. +// A map on out-of-process subframe contents is also included so the printed +// content can be composited as needed. +struct DidPrintContentParams { + // A shared memory region for the metafile data. + mojo_base.mojom.ReadOnlySharedMemoryRegion metafile_data_region; + // Content id to render frame proxy id mapping for out-of-process subframes. + map<uint32, int32> subframe_content_info; +}; + +// Parameters to describe the to-be-rendered preview document. +struct DidStartPreviewParams { + // Total page count for the rendered preview. (Not the number of pages the + // user selected to print.) + int32 page_count; + // The list of 0-based page numbers that will be rendered. + array<int32> pages_to_render; + // number of pages per sheet and should be greater or equal to 1. + int32 pages_per_sheet; + // Physical size of the page, including non-printable margins. + gfx.mojom.Size page_size; + // Scaling % to fit to page + int32 fit_to_page_scaling; +}; + // Interface implemented by a class that desires to render print documents for // Chrome print preview. interface PrintRenderer { @@ -54,6 +80,18 @@ interface PrintPreviewUI { // ensure correctness and |request_id| is the id for the preview request. [EnableIf=enable_print_preview] PrintPreviewFailed(int32 document_cookie, int32 request_id); + + // Tell the browser print preview was cancelled. |document_cookie| is the + // param to ensure correctness and |request_id| is the id for the preview + // request. + [EnableIf=enable_print_preview] + PrintPreviewCancelled(int32 document_cookie, int32 request_id); + + // Tell the browser print preview found the selected printer has invalid + // settings (which typically caused by disconnected network printer or + // printer driver is bogus). + [EnableIf=enable_print_preview] + PrinterSettingsInvalid(int32 document_cookie, int32 request_id); }; // Render process interface exposed to the browser to handle most of the @@ -88,8 +126,10 @@ interface PrintRenderFrame { [EnableIf=enable_print_preview] OnPrintPreviewDialogClosed(); - // Prints the content of an out-of-process subframe. - PrintFrameContent(PrintFrameContentParams params); + // Prints the content of an out-of-process subframe. Replies back to the + // browser the rendered subframe content that was requested. + PrintFrameContent(PrintFrameContentParams params) + => (int32 document_cookie, DidPrintContentParams params); // Tells the RenderFrame whether printing is enabled or not. SetPrintingEnabled(bool enabled); |