Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(384)

Side by Side Diff: chrome/browser/printing/print_view_manager_base.cc

Issue 2271743003: Win: Fix printing selected pages with native dialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl format Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/printing/print_job.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_job.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698