| 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 <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 TerminatePrintJob(true); | 213 TerminatePrintJob(true); |
| 214 web_contents()->Stop(); | 214 web_contents()->Stop(); |
| 215 return; | 215 return; |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 #endif // OS_WIN && !WIN_PDF_METAFILE_FOR_PRINTING | 218 #endif // OS_WIN && !WIN_PDF_METAFILE_FOR_PRINTING |
| 219 | 219 |
| 220 #if !defined(WIN_PDF_METAFILE_FOR_PRINTING) | 220 #if !defined(WIN_PDF_METAFILE_FOR_PRINTING) |
| 221 // Update the rendered document. It will send notifications to the listener. | 221 // Update the rendered document. It will send notifications to the listener. |
| 222 document->SetPage(params.page_number, | 222 document->SetPage(params.page_number, |
| 223 metafile.release(), | 223 metafile.release(), |
| 224 params.actual_shrink, | 224 #if defined(OS_WIN) |
| 225 params.page_size, | 225 params.actual_shrink, |
| 226 params.content_area); | 226 #endif // OS_WIN |
| 227 params.page_size, |
| 228 params.content_area); |
| 227 | 229 |
| 228 ShouldQuitFromInnerMessageLoop(); | 230 ShouldQuitFromInnerMessageLoop(); |
| 229 #else | 231 #else |
| 230 if (metafile_must_be_valid) { | 232 if (metafile_must_be_valid) { |
| 231 scoped_refptr<base::RefCountedBytes> bytes = new base::RefCountedBytes( | 233 scoped_refptr<base::RefCountedBytes> bytes = new base::RefCountedBytes( |
| 232 reinterpret_cast<const unsigned char*>(shared_buf.memory()), | 234 reinterpret_cast<const unsigned char*>(shared_buf.memory()), |
| 233 params.data_size); | 235 params.data_size); |
| 234 | 236 |
| 235 if (!pdf_to_emf_converter_) | 237 if (!pdf_to_emf_converter_) |
| 236 pdf_to_emf_converter_ = PdfToEmfConverter::CreateDefault(); | 238 pdf_to_emf_converter_ = PdfToEmfConverter::CreateDefault(); |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 scoped_refptr<printing::PrinterQuery> printer_query; | 590 scoped_refptr<printing::PrinterQuery> printer_query; |
| 589 printer_query = queue_->PopPrinterQuery(cookie); | 591 printer_query = queue_->PopPrinterQuery(cookie); |
| 590 if (!printer_query) | 592 if (!printer_query) |
| 591 return; | 593 return; |
| 592 BrowserThread::PostTask( | 594 BrowserThread::PostTask( |
| 593 BrowserThread::IO, FROM_HERE, | 595 BrowserThread::IO, FROM_HERE, |
| 594 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); | 596 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); |
| 595 } | 597 } |
| 596 | 598 |
| 597 } // namespace printing | 599 } // namespace printing |
| OLD | NEW |