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

Unified Diff: components/printing/renderer/print_web_view_helper.h

Issue 2780433002: add print to pdf for headless (Closed)
Patch Set: add more comment and error handle protection Created 3 years, 8 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
« no previous file with comments | « build/args/headless.gn ('k') | components/printing/renderer/print_web_view_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/printing/renderer/print_web_view_helper.h
diff --git a/components/printing/renderer/print_web_view_helper.h b/components/printing/renderer/print_web_view_helper.h
index d979333feb1fd72972fe4109e1afc061f49af2d1..7c255f246d6af06de5cc9f8c90bc0fce59f36df3 100644
--- a/components/printing/renderer/print_web_view_helper.h
+++ b/components/printing/renderer/print_web_view_helper.h
@@ -108,6 +108,14 @@ class PrintWebViewHelper
// Returns true if printing is overridden and the default behavior should be
// skipped for |frame|.
virtual bool OverridePrint(blink::WebLocalFrame* frame) = 0;
+
+#if defined(OS_MACOSX)
+ // If true, all the printed pages are returned in the first
+ // PrintHostMsg_DidPrintPage metafile, like on Linux and Windows.
+ // NOTE: This option only returns one set of page size and content area,
Lei Zhang 2017/04/07 04:09:42 NOTE: PrintHostMsg_DidPrintPage messages for all p
+ // which may lead to bug when these two parameters are different per page.
+ virtual bool UseSingleMetafile();
+#endif
};
PrintWebViewHelper(content::RenderFrame* render_frame,
@@ -283,8 +291,9 @@ class PrintWebViewHelper
// Prints the page listed in |params|.
#if defined(OS_MACOSX)
- void PrintPageInternal(const PrintMsg_PrintPage_Params& params,
- blink::WebLocalFrame* frame);
+ void PrintPagesInternal(const PrintMsg_PrintPage_Params& params,
+ blink::WebLocalFrame* frame,
+ const std::vector<int>& printed_pages);
#else
void PrintPageInternal(const PrintMsg_PrintPage_Params& params,
blink::WebLocalFrame* frame,
« no previous file with comments | « build/args/headless.gn ('k') | components/printing/renderer/print_web_view_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698