Chromium Code Reviews| 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 55a2e6be638d188e5fc8b1415c7fc76f5332be3a..8f555ded091c9f0e92d06ce30f505cc96baa6bfb 100644 |
| --- a/chrome/renderer/print_web_view_helper.h |
| +++ b/chrome/renderer/print_web_view_helper.h |
| @@ -18,6 +18,7 @@ |
| #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCanvas.h" |
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" |
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h" |
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebPrintScalingOption.h" |
|
kmadhusu
2012/04/20 22:23:58
Style??? Do I need to intent 4 space?
kmadhusu
2012/04/23 17:39:10
Leaving this as it is.
|
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebViewClient.h" |
| #include "ui/gfx/size.h" |
| @@ -42,7 +43,8 @@ class PrepareFrameAndViewForPrint { |
| // printed. |
| PrepareFrameAndViewForPrint(const PrintMsg_Print_Params& print_params, |
| WebKit::WebFrame* frame, |
| - const WebKit::WebNode& node); |
| + const WebKit::WebNode& node, |
| + WebKit::WebPrintScalingOption option); |
| ~PrepareFrameAndViewForPrint(); |
| void UpdatePrintParams(const PrintMsg_Print_Params& print_params); |
| @@ -62,17 +64,22 @@ class PrepareFrameAndViewForPrint { |
| void FinishPrinting(); |
| private: |
| - void StartPrinting(const gfx::Size& print_params); |
| + void StartPrinting(const gfx::Size& canvas_size, |
| + const gfx::Rect& printable_area, |
| + const gfx::Size& paper_size); |
| WebKit::WebFrame* frame_; |
| WebKit::WebNode node_to_print_; |
| WebKit::WebView* web_view_; |
| gfx::Size print_canvas_size_; |
| + gfx::Rect printable_area_; |
| + gfx::Size paper_size_; |
| gfx::Size prev_view_size_; |
| gfx::Size prev_scroll_offset_; |
| int dpi_; |
| int expected_pages_count_; |
| bool use_browser_overlays_; |
| + WebKit::WebPrintScalingOption print_scaling_option_; |
| bool finished_; |
| DISALLOW_COPY_AND_ASSIGN(PrepareFrameAndViewForPrint); |
| @@ -200,7 +207,7 @@ class PrintWebViewHelper |
| // Initialize print page settings with default settings. |
| // Used only for native printing workflow. |
| - bool InitPrintSettings(); |
| + bool InitPrintSettings(bool fit_to_paper_size); |
| // Initialize print page settings with default settings and prepare the frame |
| // for print. A new PrepareFrameAndViewForPrint is created to fulfill the |
| @@ -365,6 +372,9 @@ class PrintWebViewHelper |
| // True, when printing from print preview. |
| bool print_for_preview_; |
| + // Specifies the print scaling option for the current workflow. |
| + WebKit::WebPrintScalingOption print_scaling_option_; |
| + |
| scoped_ptr<PrintMsg_PrintPages_Params> old_print_pages_params_; |
| // Strings generated by the browser process to be printed as headers and |
| @@ -388,7 +398,8 @@ 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, |
| - bool ignore_css_margins); |
| + bool ignore_css_margins, |
| + WebKit::WebPrintScalingOption scaling_option); |
| // Called after a page gets rendered. |page_time| is how long the |
| // rendering took. |