OLD | NEW |
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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/process/process_handle.h" | 9 #include "base/process/process_handle.h" |
10 #include "components/printing/common/print_messages.h" | 10 #include "components/printing/common/print_messages.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 printed_page_params.data_size = metafile.GetDataSize(); | 104 printed_page_params.data_size = metafile.GetDataSize(); |
105 printed_page_params.document_cookie = params.params.document_cookie; | 105 printed_page_params.document_cookie = params.params.document_cookie; |
106 printed_page_params.page_size = params.params.page_size; | 106 printed_page_params.page_size = params.params.page_size; |
107 | 107 |
108 for (size_t i = 0; i < printed_pages.size(); ++i) { | 108 for (size_t i = 0; i < printed_pages.size(); ++i) { |
109 printed_page_params.page_number = printed_pages[i]; | 109 printed_page_params.page_number = printed_pages[i]; |
110 printed_page_params.page_size = page_size_in_dpi[i]; | 110 printed_page_params.page_size = page_size_in_dpi[i]; |
111 printed_page_params.content_area = content_area_in_dpi[i]; | 111 printed_page_params.content_area = content_area_in_dpi[i]; |
112 Send(new PrintHostMsg_DidPrintPage(routing_id(), printed_page_params)); | 112 Send(new PrintHostMsg_DidPrintPage(routing_id(), printed_page_params)); |
113 // Send the rest of the pages with an invalid metafile handle. | 113 // Send the rest of the pages with an invalid metafile handle. |
114 printed_page_params.metafile_data_handle = nullptr; | 114 printed_page_params.metafile_data_handle = base::SharedMemoryHandle(); |
115 } | 115 } |
116 return true; | 116 return true; |
117 } | 117 } |
118 | 118 |
119 void PrintWebViewHelper::PrintPageInternal( | 119 void PrintWebViewHelper::PrintPageInternal( |
120 const PrintMsg_PrintPage_Params& params, | 120 const PrintMsg_PrintPage_Params& params, |
121 WebFrame* frame, | 121 WebFrame* frame, |
122 PdfMetafileSkia* metafile, | 122 PdfMetafileSkia* metafile, |
123 gfx::Size* page_size_in_dpi, | 123 gfx::Size* page_size_in_dpi, |
124 gfx::Rect* content_area_in_dpi) { | 124 gfx::Rect* content_area_in_dpi) { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 shared_mem_handle)) { | 200 shared_mem_handle)) { |
201 return false; | 201 return false; |
202 } | 202 } |
203 | 203 |
204 Send(new PrintHostMsg_DuplicateSection(routing_id(), *shared_mem_handle, | 204 Send(new PrintHostMsg_DuplicateSection(routing_id(), *shared_mem_handle, |
205 shared_mem_handle)); | 205 shared_mem_handle)); |
206 return true; | 206 return true; |
207 } | 207 } |
208 | 208 |
209 } // namespace printing | 209 } // namespace printing |
OLD | NEW |