| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 web_contents()->Stop(); | 185 web_contents()->Stop(); |
| 186 return; | 186 return; |
| 187 } | 187 } |
| 188 } | 188 } |
| 189 | 189 |
| 190 #if defined(OS_WIN) | 190 #if defined(OS_WIN) |
| 191 print_job_->AppendPrintedPage(params.page_number); | 191 print_job_->AppendPrintedPage(params.page_number); |
| 192 if (metafile_must_be_valid) { | 192 if (metafile_must_be_valid) { |
| 193 bool print_text_with_gdi = | 193 bool print_text_with_gdi = |
| 194 document->settings().print_text_with_gdi() && | 194 document->settings().print_text_with_gdi() && |
| 195 !document->settings().printer_is_xps() && |
| 195 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 196 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 196 switches::kDisableGDITextPrinting); | 197 switches::kDisableGDITextPrinting); |
| 197 scoped_refptr<base::RefCountedBytes> bytes = new base::RefCountedBytes( | 198 scoped_refptr<base::RefCountedBytes> bytes = new base::RefCountedBytes( |
| 198 reinterpret_cast<const unsigned char*>(shared_buf->memory()), | 199 reinterpret_cast<const unsigned char*>(shared_buf->memory()), |
| 199 params.data_size); | 200 params.data_size); |
| 200 | 201 |
| 201 document->DebugDumpData(bytes.get(), FILE_PATH_LITERAL(".pdf")); | 202 document->DebugDumpData(bytes.get(), FILE_PATH_LITERAL(".pdf")); |
| 202 print_job_->StartPdfToEmfConversion( | 203 print_job_->StartPdfToEmfConversion( |
| 203 bytes, params.page_size, params.content_area, print_text_with_gdi); | 204 bytes, params.page_size, params.content_area, print_text_with_gdi); |
| 204 } | 205 } |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 scoped_refptr<PrinterQuery> printer_query; | 533 scoped_refptr<PrinterQuery> printer_query; |
| 533 printer_query = queue_->PopPrinterQuery(cookie); | 534 printer_query = queue_->PopPrinterQuery(cookie); |
| 534 if (!printer_query.get()) | 535 if (!printer_query.get()) |
| 535 return; | 536 return; |
| 536 BrowserThread::PostTask( | 537 BrowserThread::PostTask( |
| 537 BrowserThread::IO, FROM_HERE, | 538 BrowserThread::IO, FROM_HERE, |
| 538 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); | 539 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); |
| 539 } | 540 } |
| 540 | 541 |
| 541 } // namespace printing | 542 } // namespace printing |
| OLD | NEW |