OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/printing/print_view_manager_base.h" | 5 #include "chrome/browser/printing/print_view_manager_base.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 new PdfMetafileSkia(PDF_SKIA_DOCUMENT_TYPE)); | 176 new PdfMetafileSkia(PDF_SKIA_DOCUMENT_TYPE)); |
177 if (metafile_must_be_valid) { | 177 if (metafile_must_be_valid) { |
178 if (!metafile->InitFromData(shared_buf->memory(), params.data_size)) { | 178 if (!metafile->InitFromData(shared_buf->memory(), params.data_size)) { |
179 NOTREACHED() << "Invalid metafile header"; | 179 NOTREACHED() << "Invalid metafile header"; |
180 web_contents()->Stop(); | 180 web_contents()->Stop(); |
181 return; | 181 return; |
182 } | 182 } |
183 } | 183 } |
184 | 184 |
185 #if defined(OS_WIN) | 185 #if defined(OS_WIN) |
| 186 print_job_->AppendPrintedPage(params.page_number); |
186 if (metafile_must_be_valid) { | 187 if (metafile_must_be_valid) { |
187 scoped_refptr<base::RefCountedBytes> bytes = new base::RefCountedBytes( | 188 scoped_refptr<base::RefCountedBytes> bytes = new base::RefCountedBytes( |
188 reinterpret_cast<const unsigned char*>(shared_buf->memory()), | 189 reinterpret_cast<const unsigned char*>(shared_buf->memory()), |
189 params.data_size); | 190 params.data_size); |
190 | 191 |
191 document->DebugDumpData(bytes.get(), FILE_PATH_LITERAL(".pdf")); | 192 document->DebugDumpData(bytes.get(), FILE_PATH_LITERAL(".pdf")); |
192 print_job_->StartPdfToEmfConversion( | 193 print_job_->StartPdfToEmfConversion( |
193 bytes, params.page_size, params.content_area); | 194 bytes, params.page_size, params.content_area); |
194 } | 195 } |
195 #else | 196 #else |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 scoped_refptr<PrinterQuery> printer_query; | 523 scoped_refptr<PrinterQuery> printer_query; |
523 printer_query = queue_->PopPrinterQuery(cookie); | 524 printer_query = queue_->PopPrinterQuery(cookie); |
524 if (!printer_query.get()) | 525 if (!printer_query.get()) |
525 return; | 526 return; |
526 BrowserThread::PostTask( | 527 BrowserThread::PostTask( |
527 BrowserThread::IO, FROM_HERE, | 528 BrowserThread::IO, FROM_HERE, |
528 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); | 529 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); |
529 } | 530 } |
530 | 531 |
531 } // namespace printing | 532 } // namespace printing |
OLD | NEW |