| 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 "chrome/browser/printing/pdf_to_emf_converter.h" | 5 #include "chrome/browser/printing/pdf_to_emf_converter.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 base::Bind(&PdfToEmfUtilityProcessHostClient::OnTempPdfReady, this, | 333 base::Bind(&PdfToEmfUtilityProcessHostClient::OnTempPdfReady, this, |
| 334 print_text_with_gdi)); | 334 print_text_with_gdi)); |
| 335 } | 335 } |
| 336 | 336 |
| 337 void PdfToEmfUtilityProcessHostClient::OnTempPdfReady(bool print_text_with_gdi, | 337 void PdfToEmfUtilityProcessHostClient::OnTempPdfReady(bool print_text_with_gdi, |
| 338 ScopedTempFile pdf) { | 338 ScopedTempFile pdf) { |
| 339 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 339 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 340 if (!utility_process_host_ || !pdf) | 340 if (!utility_process_host_ || !pdf) |
| 341 return OnFailed(); | 341 return OnFailed(); |
| 342 // Should reply with OnPageCount(). | 342 // Should reply with OnPageCount(). |
| 343 Send(new ChromeUtilityMsg_RenderPDFPagesToMetafiles_Start( | 343 Send(new ChromeUtilityMsg_RenderPDFPagesToMetafiles( |
| 344 IPC::GetPlatformFileForTransit(pdf->GetPlatformFile(), false), settings_, | 344 IPC::GetPlatformFileForTransit(pdf->GetPlatformFile(), false), settings_, |
| 345 print_text_with_gdi)); | 345 print_text_with_gdi)); |
| 346 } | 346 } |
| 347 | 347 |
| 348 void PdfToEmfUtilityProcessHostClient::OnPageCount(int page_count) { | 348 void PdfToEmfUtilityProcessHostClient::OnPageCount(int page_count) { |
| 349 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 349 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 350 if (start_callback_.is_null()) | 350 if (start_callback_.is_null()) |
| 351 return OnFailed(); | 351 return OnFailed(); |
| 352 BrowserThread::PostTask(BrowserThread::UI, | 352 BrowserThread::PostTask(BrowserThread::UI, |
| 353 FROM_HERE, | 353 FROM_HERE, |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 | 541 |
| 542 PdfToEmfConverter::~PdfToEmfConverter() { | 542 PdfToEmfConverter::~PdfToEmfConverter() { |
| 543 } | 543 } |
| 544 | 544 |
| 545 // static | 545 // static |
| 546 std::unique_ptr<PdfToEmfConverter> PdfToEmfConverter::CreateDefault() { | 546 std::unique_ptr<PdfToEmfConverter> PdfToEmfConverter::CreateDefault() { |
| 547 return std::unique_ptr<PdfToEmfConverter>(new PdfToEmfConverterImpl()); | 547 return std::unique_ptr<PdfToEmfConverter>(new PdfToEmfConverterImpl()); |
| 548 } | 548 } |
| 549 | 549 |
| 550 } // namespace printing | 550 } // namespace printing |
| OLD | NEW |