| Index: chrome/renderer/print_web_view_helper.h
|
| diff --git a/chrome/renderer/print_web_view_helper.h b/chrome/renderer/print_web_view_helper.h
|
| index fba9530d949c2f925f55381b3570493dbbc0ac19..f38fdb45c013df20c63d89322ef4ff544d910ca5 100644
|
| --- a/chrome/renderer/print_web_view_helper.h
|
| +++ b/chrome/renderer/print_web_view_helper.h
|
| @@ -117,6 +117,12 @@ class PrintWebViewHelper
|
| // Print the document with the print preview frame/node.
|
| void OnPrintForSystemDialog();
|
|
|
| + // Update |ignore_frame_margins_css_| based on settings.
|
| + void UpdateFrameMarginsCssInfo(const base::DictionaryValue& settings);
|
| +
|
| + // Returns true if the current destination printer is PRINT_TO_PDF.
|
| + bool IsPrintToPdfRequested(const base::DictionaryValue& settings);
|
| +
|
| // Initiate print preview.
|
| void OnInitiatePrintPreview();
|
|
|
| @@ -216,12 +222,12 @@ class PrintWebViewHelper
|
| // |metafile| or a new one. In either case, the caller owns both |metafile|
|
| // and the result.
|
| printing::Metafile* RenderPage(const PrintMsg_Print_Params& params,
|
| - float* scale_factor, int page_number,
|
| + double* scale_factor, int page_number,
|
| bool is_preview, WebKit::WebFrame* frame,
|
| printing::Metafile* metafile);
|
| #elif defined(OS_MACOSX)
|
| void RenderPage(const gfx::Size& page_size, const gfx::Rect& content_area,
|
| - const float& scale_factor, int page_number,
|
| + const double& scale_factor, int page_number,
|
| WebKit::WebFrame* frame, bool is_preview,
|
| printing::Metafile* metafile);
|
| #elif defined(OS_POSIX)
|
| @@ -242,13 +248,18 @@ class PrintWebViewHelper
|
| WebKit::WebFrame* frame,
|
| int page_index,
|
| const PrintMsg_Print_Params& default_params,
|
| + bool ignore_frame_margins_css,
|
| + bool fit_to_page,
|
| + double* scale_factor,
|
| printing::PageSizeMargins* page_layout_in_points);
|
|
|
| static void UpdatePrintableSizeInPrintParameters(
|
| WebKit::WebFrame* frame,
|
| const WebKit::WebNode& node,
|
| PrepareFrameAndViewForPrint* prepare,
|
| - PrintMsg_Print_Params* params);
|
| + const PrintMsg_Print_Params& params,
|
| + bool ignore_frame_margins_css,
|
| + bool fit_to_page);
|
|
|
| // Given the |device| and |canvas| to draw on, prints the appropriate headers
|
| // and footers using strings from |header_footer_info| on to the canvas.
|
| @@ -299,6 +310,11 @@ class PrintWebViewHelper
|
| scoped_ptr<PrintMsg_PrintPages_Params> print_pages_params_;
|
| bool is_preview_enabled_;
|
| bool is_print_ready_metafile_sent_;
|
| + bool ignore_frame_margins_css_;
|
| +
|
| + // True if we need to auto fit to page else false.
|
| + // NOTE: When we print to pdf, we don't fit to page.
|
| + bool fit_to_page_;
|
|
|
| // Used for scripted initiated printing blocking.
|
| base::Time last_cancelled_script_print_;
|
| @@ -343,7 +359,9 @@ class PrintWebViewHelper
|
|
|
| // Create the print preview document. |pages| is empty to print all pages.
|
| bool CreatePreviewDocument(PrintMsg_Print_Params* params,
|
| - const std::vector<int>& pages);
|
| + const std::vector<int>& pages,
|
| + bool ignore_frame_margins_css,
|
| + bool fit_to_page);
|
|
|
| // Called after a page gets rendered. |page_time| is how long the
|
| // rendering took.
|
|
|