| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ | 5 #ifndef CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ |
| 6 #define CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ | 6 #define CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 int page_count, | 199 int page_count, |
| 200 const gfx::Size& canvas_size); | 200 const gfx::Size& canvas_size); |
| 201 void FinishFramePrinting(); | 201 void FinishFramePrinting(); |
| 202 | 202 |
| 203 // Prints the page listed in |params|. | 203 // Prints the page listed in |params|. |
| 204 #if defined(OS_LINUX) || defined(OS_ANDROID) | 204 #if defined(OS_LINUX) || defined(OS_ANDROID) |
| 205 void PrintPageInternal(const PrintMsg_PrintPage_Params& params, | 205 void PrintPageInternal(const PrintMsg_PrintPage_Params& params, |
| 206 const gfx::Size& canvas_size, | 206 const gfx::Size& canvas_size, |
| 207 blink::WebFrame* frame, | 207 blink::WebFrame* frame, |
| 208 Metafile* metafile); | 208 Metafile* metafile); |
| 209 #elif defined(WIN_PDF_METAFILE_FOR_PRINTING) |
| 210 void PrintPageInternal(const PrintMsg_PrintPage_Params& params, |
| 211 const gfx::Size& canvas_size, |
| 212 blink::WebFrame* frame, |
| 213 Metafile* metafile, |
| 214 bool is_preview, |
| 215 double* actual_shrink, |
| 216 gfx::Size* page_size_in_dpi, |
| 217 gfx::Rect* content_area_in_dpi); |
| 209 #else | 218 #else |
| 210 void PrintPageInternal(const PrintMsg_PrintPage_Params& params, | 219 void PrintPageInternal(const PrintMsg_PrintPage_Params& params, |
| 211 const gfx::Size& canvas_size, | 220 const gfx::Size& canvas_size, |
| 212 blink::WebFrame* frame); | 221 blink::WebFrame* frame); |
| 213 #endif | 222 #endif |
| 214 | 223 |
| 215 // Render the frame for printing. | 224 // Render the frame for printing. |
| 216 bool RenderPagesForPrint(blink::WebLocalFrame* frame, | 225 bool RenderPagesForPrint(blink::WebLocalFrame* frame, |
| 217 const blink::WebNode& node); | 226 const blink::WebNode& node); |
| 218 | 227 |
| 219 // Platform specific helper function for rendering page(s) to |metafile|. | 228 // Platform specific helper function for rendering page(s) to |metafile|. |
| 220 #if defined(OS_WIN) | 229 #if defined(OS_WIN) && !defined(WIN_PDF_METAFILE_FOR_PRINTING) |
| 221 void RenderPage(const PrintMsg_Print_Params& params, | 230 void RenderPage(const PrintMsg_Print_Params& params, |
| 222 int page_number, | 231 int page_number, |
| 223 blink::WebFrame* frame, | 232 blink::WebFrame* frame, |
| 224 bool is_preview, | 233 bool is_preview, |
| 225 Metafile* metafile, | 234 Metafile* metafile, |
| 226 double* scale_factor, | 235 double* scale_factor, |
| 227 gfx::Size* page_size_in_dpi, | 236 gfx::Size* page_size_in_dpi, |
| 228 gfx::Rect* content_area_in_dpi); | 237 gfx::Rect* content_area_in_dpi); |
| 229 #elif defined(OS_MACOSX) | 238 #elif defined(OS_MACOSX) |
| 230 void RenderPage(const PrintMsg_Print_Params& params, | 239 void RenderPage(const PrintMsg_Print_Params& params, |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 PrintPreviewContext print_preview_context_; | 457 PrintPreviewContext print_preview_context_; |
| 449 bool is_loading_; | 458 bool is_loading_; |
| 450 bool is_scripted_preview_delayed_; | 459 bool is_scripted_preview_delayed_; |
| 451 base::WeakPtrFactory<PrintWebViewHelper> weak_ptr_factory_; | 460 base::WeakPtrFactory<PrintWebViewHelper> weak_ptr_factory_; |
| 452 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); | 461 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); |
| 453 }; | 462 }; |
| 454 | 463 |
| 455 } // namespace printing | 464 } // namespace printing |
| 456 | 465 |
| 457 #endif // CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ | 466 #endif // CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ |
| OLD | NEW |