Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: components/printing/renderer/print_web_view_helper_pdf_win.cc

Issue 2806083002: Remove PrintMsg_PrintPage_Params. (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/printing/renderer/print_web_view_helper_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "components/printing/renderer/print_web_view_helper.h" 5 #include "components/printing/renderer/print_web_view_helper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/process/process_handle.h" 10 #include "base/process/process_handle.h"
(...skipping 11 matching lines...) Expand all
22 if (printed_pages.empty()) 22 if (printed_pages.empty())
23 return false; 23 return false;
24 24
25 std::vector<gfx::Size> page_size_in_dpi(printed_pages.size()); 25 std::vector<gfx::Size> page_size_in_dpi(printed_pages.size());
26 std::vector<gfx::Rect> content_area_in_dpi(printed_pages.size()); 26 std::vector<gfx::Rect> content_area_in_dpi(printed_pages.size());
27 std::vector<gfx::Rect> printable_area_in_dpi(printed_pages.size()); 27 std::vector<gfx::Rect> printable_area_in_dpi(printed_pages.size());
28 28
29 PdfMetafileSkia metafile(PDF_SKIA_DOCUMENT_TYPE); 29 PdfMetafileSkia metafile(PDF_SKIA_DOCUMENT_TYPE);
30 CHECK(metafile.Init()); 30 CHECK(metafile.Init());
31 31
32 PrintMsg_PrintPage_Params page_params;
33 page_params.params = params.params;
34 for (size_t i = 0; i < printed_pages.size(); ++i) { 32 for (size_t i = 0; i < printed_pages.size(); ++i) {
35 page_params.page_number = printed_pages[i]; 33 PrintPageInternal(params.params, printed_pages[i], frame, &metafile,
36 PrintPageInternal(page_params, frame, &metafile, &page_size_in_dpi[i], 34 &page_size_in_dpi[i], &content_area_in_dpi[i],
37 &content_area_in_dpi[i], &printable_area_in_dpi[i]); 35 &printable_area_in_dpi[i]);
38 } 36 }
39 37
40 // blink::printEnd() for PDF should be called before metafile is closed. 38 // blink::printEnd() for PDF should be called before metafile is closed.
41 FinishFramePrinting(); 39 FinishFramePrinting();
42 40
43 metafile.FinishDocument(); 41 metafile.FinishDocument();
44 42
45 PrintHostMsg_DidPrintPage_Params printed_page_params; 43 PrintHostMsg_DidPrintPage_Params printed_page_params;
46 if (!CopyMetafileDataToSharedMem( 44 if (!CopyMetafileDataToSharedMem(
47 metafile, &printed_page_params.metafile_data_handle)) { 45 metafile, &printed_page_params.metafile_data_handle)) {
(...skipping 15 matching lines...) Expand all
63 // Send the rest of the pages with an invalid metafile handle. 61 // Send the rest of the pages with an invalid metafile handle.
64 // TODO(erikchen): Fix semantics. See https://crbug.com/640840 62 // TODO(erikchen): Fix semantics. See https://crbug.com/640840
65 if (printed_page_params.metafile_data_handle.IsValid()) 63 if (printed_page_params.metafile_data_handle.IsValid())
66 printed_page_params.metafile_data_handle = base::SharedMemoryHandle(); 64 printed_page_params.metafile_data_handle = base::SharedMemoryHandle();
67 } 65 }
68 return true; 66 return true;
69 } 67 }
70 #endif // BUILDFLAG(ENABLE_BASIC_PRINTING) 68 #endif // BUILDFLAG(ENABLE_BASIC_PRINTING)
71 69
72 } // namespace printing 70 } // namespace printing
OLDNEW
« no previous file with comments | « components/printing/renderer/print_web_view_helper_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698