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 COMPONENTS_PRINTING_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 5 #ifndef COMPONENTS_PRINTING_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
6 #define COMPONENTS_PRINTING_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 6 #define COMPONENTS_PRINTING_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 | 283 |
284 // Prints the page listed in |params|. | 284 // Prints the page listed in |params|. |
285 #if defined(OS_MACOSX) | 285 #if defined(OS_MACOSX) |
286 void PrintPageInternal(const PrintMsg_PrintPage_Params& params, | 286 void PrintPageInternal(const PrintMsg_PrintPage_Params& params, |
287 blink::WebLocalFrame* frame); | 287 blink::WebLocalFrame* frame); |
288 #else | 288 #else |
289 void PrintPageInternal(const PrintMsg_PrintPage_Params& params, | 289 void PrintPageInternal(const PrintMsg_PrintPage_Params& params, |
290 blink::WebLocalFrame* frame, | 290 blink::WebLocalFrame* frame, |
291 PdfMetafileSkia* metafile, | 291 PdfMetafileSkia* metafile, |
292 gfx::Size* page_size_in_dpi, | 292 gfx::Size* page_size_in_dpi, |
293 gfx::Rect* content_area_in_dpi); | 293 gfx::Rect* content_area_in_dpi, |
| 294 gfx::Rect* printable_area_in_dpi); |
294 #endif // defined(OS_MACOSX) | 295 #endif // defined(OS_MACOSX) |
295 | 296 |
296 // Platform specific helper function for rendering page(s) to |metafile|. | 297 // Platform specific helper function for rendering page(s) to |metafile|. |
297 #if defined(OS_MACOSX) | 298 #if defined(OS_MACOSX) |
298 void RenderPage(const PrintMsg_Print_Params& params, | 299 void RenderPage(const PrintMsg_Print_Params& params, |
299 int page_number, | 300 int page_number, |
300 blink::WebLocalFrame* frame, | 301 blink::WebLocalFrame* frame, |
301 bool is_preview, | 302 bool is_preview, |
302 PdfMetafileSkia* metafile, | 303 PdfMetafileSkia* metafile, |
303 gfx::Size* page_size, | 304 gfx::Size* page_size, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 bool PreviewPageRendered(int page_number, PdfMetafileSkia* metafile); | 376 bool PreviewPageRendered(int page_number, PdfMetafileSkia* metafile); |
376 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) | 377 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
377 | 378 |
378 void SetPrintPagesParams(const PrintMsg_PrintPages_Params& settings); | 379 void SetPrintPagesParams(const PrintMsg_PrintPages_Params& settings); |
379 | 380 |
380 // WebView used only to print the selection. | 381 // WebView used only to print the selection. |
381 std::unique_ptr<PrepareFrameAndViewForPrint> prep_frame_view_; | 382 std::unique_ptr<PrepareFrameAndViewForPrint> prep_frame_view_; |
382 bool reset_prep_frame_view_; | 383 bool reset_prep_frame_view_; |
383 | 384 |
384 std::unique_ptr<PrintMsg_PrintPages_Params> print_pages_params_; | 385 std::unique_ptr<PrintMsg_PrintPages_Params> print_pages_params_; |
| 386 gfx::Rect printer_printable_area_; |
385 bool is_print_ready_metafile_sent_; | 387 bool is_print_ready_metafile_sent_; |
386 bool ignore_css_margins_; | 388 bool ignore_css_margins_; |
387 | 389 |
388 bool is_printing_enabled_; | 390 bool is_printing_enabled_; |
389 | 391 |
390 // Let the browser process know of a printing failure. Only set to false when | 392 // Let the browser process know of a printing failure. Only set to false when |
391 // the failure came from the browser in the first place. | 393 // the failure came from the browser in the first place. |
392 bool notify_browser_of_print_failure_; | 394 bool notify_browser_of_print_failure_; |
393 | 395 |
394 // True, when printing from print preview. | 396 // True, when printing from print preview. |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 base::Closure on_stop_loading_closure_; | 539 base::Closure on_stop_loading_closure_; |
538 | 540 |
539 base::WeakPtrFactory<PrintWebViewHelper> weak_ptr_factory_; | 541 base::WeakPtrFactory<PrintWebViewHelper> weak_ptr_factory_; |
540 | 542 |
541 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); | 543 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); |
542 }; | 544 }; |
543 | 545 |
544 } // namespace printing | 546 } // namespace printing |
545 | 547 |
546 #endif // COMPONENTS_PRINTING_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 548 #endif // COMPONENTS_PRINTING_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
OLD | NEW |