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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 printed_page_params.content_area = params.params.printable_area; | 103 printed_page_params.content_area = params.params.printable_area; |
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 printed_page_params.metafile_data_handle = INVALID_HANDLE_VALUE; | 113 printed_page_params.metafile_data_handle = NULL; |
114 } | 114 } |
115 return true; | 115 return true; |
116 } | 116 } |
117 | 117 |
118 void PrintWebViewHelper::PrintPageInternal( | 118 void PrintWebViewHelper::PrintPageInternal( |
119 const PrintMsg_PrintPage_Params& params, | 119 const PrintMsg_PrintPage_Params& params, |
120 WebFrame* frame, | 120 WebFrame* frame, |
121 PdfMetafileSkia* metafile, | 121 PdfMetafileSkia* metafile, |
122 gfx::Size* page_size_in_dpi, | 122 gfx::Size* page_size_in_dpi, |
123 gfx::Rect* content_area_in_dpi) { | 123 gfx::Rect* content_area_in_dpi) { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 shared_mem_handle)) { | 199 shared_mem_handle)) { |
200 return false; | 200 return false; |
201 } | 201 } |
202 | 202 |
203 Send(new PrintHostMsg_DuplicateSection(routing_id(), *shared_mem_handle, | 203 Send(new PrintHostMsg_DuplicateSection(routing_id(), *shared_mem_handle, |
204 shared_mem_handle)); | 204 shared_mem_handle)); |
205 return true; | 205 return true; |
206 } | 206 } |
207 | 207 |
208 } // namespace printing | 208 } // namespace printing |
OLD | NEW |