| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 // Page Printing / Rendering ------------------------------------------------ | 194 // Page Printing / Rendering ------------------------------------------------ |
| 195 | 195 |
| 196 void OnFramePreparedForPrintPages(); | 196 void OnFramePreparedForPrintPages(); |
| 197 void PrintPages(); | 197 void PrintPages(); |
| 198 bool PrintPagesNative(blink::WebFrame* frame, | 198 bool PrintPagesNative(blink::WebFrame* frame, |
| 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 defined(PRINTING_WIN_USES_PDF_AS_METAFILE) |
| 205 void PrintPageInternal(const PrintMsg_PrintPage_Params& params, | 206 void PrintPageInternal(const PrintMsg_PrintPage_Params& params, |
| 206 const gfx::Size& canvas_size, | 207 const gfx::Size& canvas_size, |
| 207 blink::WebFrame* frame, | 208 blink::WebFrame* frame, |
| 208 Metafile* metafile); | 209 Metafile* metafile); |
| 209 #else | 210 #else |
| 210 void PrintPageInternal(const PrintMsg_PrintPage_Params& params, | 211 void PrintPageInternal(const PrintMsg_PrintPage_Params& params, |
| 211 const gfx::Size& canvas_size, | 212 const gfx::Size& canvas_size, |
| 212 blink::WebFrame* frame); | 213 blink::WebFrame* frame); |
| 213 #endif | 214 #endif |
| 214 | 215 |
| 215 // Render the frame for printing. | 216 // Render the frame for printing. |
| 216 bool RenderPagesForPrint(blink::WebLocalFrame* frame, | 217 bool RenderPagesForPrint(blink::WebLocalFrame* frame, |
| 217 const blink::WebNode& node); | 218 const blink::WebNode& node); |
| 218 | 219 |
| 219 // Platform specific helper function for rendering page(s) to |metafile|. | 220 // Platform specific helper function for rendering page(s) to |metafile|. |
| 220 #if defined(OS_WIN) | 221 #if !defined(PRINTING_WIN_USES_PDF_AS_METAFILE) |
| 221 void RenderPage(const PrintMsg_Print_Params& params, | 222 void RenderPage(const PrintMsg_Print_Params& params, |
| 222 int page_number, | 223 int page_number, |
| 223 blink::WebFrame* frame, | 224 blink::WebFrame* frame, |
| 224 bool is_preview, | 225 bool is_preview, |
| 225 Metafile* metafile, | 226 Metafile* metafile, |
| 226 double* scale_factor, | 227 double* scale_factor, |
| 227 gfx::Size* page_size_in_dpi, | 228 gfx::Size* page_size_in_dpi, |
| 228 gfx::Rect* content_area_in_dpi); | 229 gfx::Rect* content_area_in_dpi); |
| 229 #elif defined(OS_MACOSX) | 230 #elif defined(OS_MACOSX) |
| 230 void RenderPage(const PrintMsg_Print_Params& params, | 231 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_; | 449 PrintPreviewContext print_preview_context_; |
| 449 bool is_loading_; | 450 bool is_loading_; |
| 450 bool is_scripted_preview_delayed_; | 451 bool is_scripted_preview_delayed_; |
| 451 base::WeakPtrFactory<PrintWebViewHelper> weak_ptr_factory_; | 452 base::WeakPtrFactory<PrintWebViewHelper> weak_ptr_factory_; |
| 452 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); | 453 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); |
| 453 }; | 454 }; |
| 454 | 455 |
| 455 } // namespace printing | 456 } // namespace printing |
| 456 | 457 |
| 457 #endif // CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ | 458 #endif // CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ |
| OLD | NEW |