OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.h" | 5 #include "chrome/browser/printing/print_view_manager.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 metafile->RasterizeMetafile(raster_size)); | 267 metafile->RasterizeMetafile(raster_size)); |
268 if (raster_metafile.get()) { | 268 if (raster_metafile.get()) { |
269 metafile.swap(raster_metafile); | 269 metafile.swap(raster_metafile); |
270 } else if (big_emf) { | 270 } else if (big_emf) { |
271 // Don't fall back to emf here. | 271 // Don't fall back to emf here. |
272 NOTREACHED() << "size:" << params.data_size; | 272 NOTREACHED() << "size:" << params.data_size; |
273 TerminatePrintJob(true); | 273 TerminatePrintJob(true); |
274 web_contents()->Stop(); | 274 web_contents()->Stop(); |
275 return; | 275 return; |
276 } | 276 } |
277 } else if (!print_job_->settings().supports_alpha_blend() && | |
278 metafile->IsAlphaBlendUsed()) { | |
279 scoped_ptr<NativeMetafile> raster_metafile( | |
280 metafile->RasterizeAlphaBlend()); | |
281 if (raster_metafile.get()) | |
282 metafile.swap(raster_metafile); | |
283 } | 277 } |
284 | |
285 #endif | 278 #endif |
286 | 279 |
287 // Update the rendered document. It will send notifications to the listener. | 280 // Update the rendered document. It will send notifications to the listener. |
288 document->SetPage(params.page_number, | 281 document->SetPage(params.page_number, |
289 metafile.release(), | 282 metafile.release(), |
290 params.actual_shrink, | 283 params.actual_shrink, |
291 params.page_size, | 284 params.page_size, |
292 params.content_area); | 285 params.content_area); |
293 | 286 |
294 ShouldQuitFromInnerMessageLoop(); | 287 ShouldQuitFromInnerMessageLoop(); |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 scoped_refptr<printing::PrinterQuery> printer_query; | 679 scoped_refptr<printing::PrinterQuery> printer_query; |
687 print_job_manager->PopPrinterQuery(cookie, &printer_query); | 680 print_job_manager->PopPrinterQuery(cookie, &printer_query); |
688 if (!printer_query.get()) | 681 if (!printer_query.get()) |
689 return; | 682 return; |
690 BrowserThread::PostTask( | 683 BrowserThread::PostTask( |
691 BrowserThread::IO, FROM_HERE, | 684 BrowserThread::IO, FROM_HERE, |
692 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); | 685 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); |
693 } | 686 } |
694 | 687 |
695 } // namespace printing | 688 } // namespace printing |
OLD | NEW |