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 <utility> |
| 8 |
7 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 10 #include "base/bind.h" |
9 #include "base/location.h" | 11 #include "base/location.h" |
10 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
11 #include "base/prefs/pref_service.h" | 13 #include "base/prefs/pref_service.h" |
12 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
13 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
14 #include "base/thread_task_runner_handle.h" | 16 #include "base/thread_task_runner_handle.h" |
15 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
16 #include "build/build_config.h" | 18 #include "build/build_config.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 scoped_refptr<base::RefCountedBytes> bytes = new base::RefCountedBytes( | 186 scoped_refptr<base::RefCountedBytes> bytes = new base::RefCountedBytes( |
185 reinterpret_cast<const unsigned char*>(shared_buf->memory()), | 187 reinterpret_cast<const unsigned char*>(shared_buf->memory()), |
186 params.data_size); | 188 params.data_size); |
187 | 189 |
188 document->DebugDumpData(bytes.get(), FILE_PATH_LITERAL(".pdf")); | 190 document->DebugDumpData(bytes.get(), FILE_PATH_LITERAL(".pdf")); |
189 print_job_->StartPdfToEmfConversion( | 191 print_job_->StartPdfToEmfConversion( |
190 bytes, params.page_size, params.content_area); | 192 bytes, params.page_size, params.content_area); |
191 } | 193 } |
192 #else | 194 #else |
193 // Update the rendered document. It will send notifications to the listener. | 195 // Update the rendered document. It will send notifications to the listener. |
194 document->SetPage(params.page_number, | 196 document->SetPage(params.page_number, std::move(metafile), params.page_size, |
195 metafile.Pass(), | |
196 params.page_size, | |
197 params.content_area); | 197 params.content_area); |
198 | 198 |
199 ShouldQuitFromInnerMessageLoop(); | 199 ShouldQuitFromInnerMessageLoop(); |
200 #endif | 200 #endif |
201 } | 201 } |
202 | 202 |
203 void PrintViewManagerBase::OnPrintingFailed(int cookie) { | 203 void PrintViewManagerBase::OnPrintingFailed(int cookie) { |
204 PrintManager::OnPrintingFailed(cookie); | 204 PrintManager::OnPrintingFailed(cookie); |
205 | 205 |
206 #if defined(ENABLE_PRINT_PREVIEW) | 206 #if defined(ENABLE_PRINT_PREVIEW) |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 scoped_refptr<printing::PrinterQuery> printer_query; | 530 scoped_refptr<printing::PrinterQuery> printer_query; |
531 printer_query = queue_->PopPrinterQuery(cookie); | 531 printer_query = queue_->PopPrinterQuery(cookie); |
532 if (!printer_query.get()) | 532 if (!printer_query.get()) |
533 return; | 533 return; |
534 BrowserThread::PostTask( | 534 BrowserThread::PostTask( |
535 BrowserThread::IO, FROM_HERE, | 535 BrowserThread::IO, FROM_HERE, |
536 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); | 536 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); |
537 } | 537 } |
538 | 538 |
539 } // namespace printing | 539 } // namespace printing |
OLD | NEW |