diff options
Diffstat (limited to 'chromium/chrome/browser/printing/print_view_manager.h')
-rw-r--r-- | chromium/chrome/browser/printing/print_view_manager.h | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/chromium/chrome/browser/printing/print_view_manager.h b/chromium/chrome/browser/printing/print_view_manager.h index 8415c9ccf35..87192a1f6f7 100644 --- a/chromium/chrome/browser/printing/print_view_manager.h +++ b/chromium/chrome/browser/printing/print_view_manager.h @@ -5,9 +5,13 @@ #ifndef CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_H_ #define CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_H_ +#include <map> + #include "base/macros.h" #include "chrome/browser/printing/print_view_manager_base.h" +#include "components/printing/common/print.mojom.h" #include "content/public/browser/web_contents_user_data.h" +#include "mojo/public/cpp/bindings/associated_remote.h" #include "printing/buildflags/buildflags.h" namespace content { @@ -33,12 +37,17 @@ class PrintViewManager : public PrintViewManagerBase, // preview dialog. bool BasicPrint(content::RenderFrameHost* rfh); - // Initiate print preview of the current document by first notifying the - // renderer. Since this happens asynchronous, the print preview dialog - // creation will not be completed on the return of this function. Returns - // false if print preview is impossible at the moment. + // Initiate print preview of the current document and specify whether a + // selection or the entire frame is being printed. bool PrintPreviewNow(content::RenderFrameHost* rfh, bool has_selection); + // Initiate print preview of the current document and provide the renderer + // a printing::mojom::PrintRenderer to perform the actual rendering of + // the print document. + bool PrintPreviewWithPrintRenderer( + content::RenderFrameHost* rfh, + mojom::PrintRendererAssociatedPtrInfo print_renderer); + // Notify PrintViewManager that print preview is starting in the renderer for // a particular WebNode. void PrintPreviewForWebNode(content::RenderFrameHost* rfh); @@ -73,6 +82,20 @@ class PrintViewManager : public PrintViewManagerBase, struct FrameDispatchHelper; + // Helper method to fetch the PrintRenderFrame associated remote interface + // pointer. + const mojo::AssociatedRemote<printing::mojom::PrintRenderFrame>& + GetPrintRenderFrame(content::RenderFrameHost* rfh); + + // Helper method for PrintPreviewNow() and PrintPreviewWithRenderer(). + // Initiate print preview of the current document by first notifying the + // renderer. Since this happens asynchronously, the print preview dialog + // creation will not be completed on the return of this function. Returns + // false if print preview is impossible at the moment. + bool PrintPreview(content::RenderFrameHost* rfh, + mojom::PrintRendererAssociatedPtrInfo print_renderer, + bool has_selection); + // IPC Message handlers. void OnDidShowPrintDialog(content::RenderFrameHost* rfh); void OnSetupScriptedPrintPreview(content::RenderFrameHost* rfh, @@ -102,6 +125,13 @@ class PrintViewManager : public PrintViewManagerBase, // flag is true between PrintForSystemDialogNow() and PrintPreviewDone(). bool is_switching_to_system_dialog_ = false; + // Stores a PrintRenderFrame associated remote with the RenderFrameHost used + // to bind it. The PrintRenderFrame is used to transmit mojo interface method + // calls to the associated receiver. + std::map<content::RenderFrameHost*, + mojo::AssociatedRemote<printing::mojom::PrintRenderFrame>> + print_render_frames_; + WEB_CONTENTS_USER_DATA_KEY_DECL(); DISALLOW_COPY_AND_ASSIGN(PrintViewManager); |