printing_handler_win.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Copyright 2014 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. #ifndef CHROME_UTILITY_PRINTING_HANDLER_WIN_H_
  5. #define CHROME_UTILITY_PRINTING_HANDLER_WIN_H_
  6. #include "base/compiler_specific.h"
  7. #include "base/macros.h"
  8. #include "chrome/utility/utility_message_handler.h"
  9. #include "ipc/ipc_platform_file.h"
  10. #include "printing/pdf_render_settings.h"
  11. namespace printing {
  12. class PdfRenderSettings;
  13. struct PwgRasterSettings;
  14. struct PageRange;
  15. // Dispatches IPCs for printing.
  16. class PrintingHandlerWin : public UtilityMessageHandler {
  17. public:
  18. PrintingHandlerWin();
  19. ~PrintingHandlerWin() override;
  20. // IPC::Listener:
  21. bool OnMessageReceived(const IPC::Message& message) override;
  22. private:
  23. // IPC message handlers.
  24. void OnRenderPDFPagesToMetafile(IPC::PlatformFileForTransit pdf_transit,
  25. const PdfRenderSettings& settings);
  26. void OnRenderPDFPagesToMetafileGetPage(
  27. int page_number,
  28. IPC::PlatformFileForTransit output_file);
  29. void OnRenderPDFPagesToMetafileStop();
  30. int LoadPDF(base::File pdf_file);
  31. bool RenderPdfPageToMetafile(int page_number,
  32. base::File output_file,
  33. float* scale_factor,
  34. bool postscript);
  35. std::vector<char> pdf_data_;
  36. PdfRenderSettings pdf_rendering_settings_;
  37. DISALLOW_COPY_AND_ASSIGN(PrintingHandlerWin);
  38. };
  39. } // namespace printing
  40. #endif // CHROME_UTILITY_PRINTING_HANDLER_WIN_H_