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/service/cloud_print/print_system.h" | 5 #include "chrome/service/cloud_print/print_system.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 int offset_y = ::GetDeviceCaps(printer_dc_.Get(), PHYSICALOFFSETY); | 329 int offset_y = ::GetDeviceCaps(printer_dc_.Get(), PHYSICALOFFSETY); |
330 XFORM xform = {0}; | 330 XFORM xform = {0}; |
331 xform.eDx = static_cast<float>(-offset_x); | 331 xform.eDx = static_cast<float>(-offset_x); |
332 xform.eDy = static_cast<float>(-offset_y); | 332 xform.eDy = static_cast<float>(-offset_y); |
333 xform.eM11 = xform.eM22 = 1.0 / scale_factor; | 333 xform.eM11 = xform.eM22 = 1.0 / scale_factor; |
334 SetWorldTransform(printer_dc_.Get(), &xform); | 334 SetWorldTransform(printer_dc_.Get(), &xform); |
335 } | 335 } |
336 | 336 |
337 // ServiceUtilityProcessHost::Client implementation. | 337 // ServiceUtilityProcessHost::Client implementation. |
338 virtual void OnRenderPDFPagesToMetafileSucceeded( | 338 virtual void OnRenderPDFPagesToMetafileSucceeded( |
339 const printing::Emf& metafile, | 339 const printing::MetafilePlayer& metafile, |
340 int highest_rendered_page_number, | 340 int highest_rendered_page_number, |
341 double scale_factor) OVERRIDE { | 341 double scale_factor) OVERRIDE { |
342 PreparePageDCForPrinting(printer_dc_.Get(), scale_factor); | 342 PreparePageDCForPrinting(printer_dc_.Get(), scale_factor); |
343 metafile.SafePlayback(printer_dc_.Get()); | 343 metafile.SafePlayback(printer_dc_.Get()); |
344 bool done_printing = (highest_rendered_page_number != | 344 bool done_printing = (highest_rendered_page_number != |
345 last_page_printed_ + kPageCountPerBatch); | 345 last_page_printed_ + kPageCountPerBatch); |
346 last_page_printed_ = highest_rendered_page_number; | 346 last_page_printed_ = highest_rendered_page_number; |
347 if (done_printing) | 347 if (done_printing) |
348 PrintJobDone(); | 348 PrintJobDone(); |
349 else | 349 else |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 } | 840 } |
841 | 841 |
842 } // namespace | 842 } // namespace |
843 | 843 |
844 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( | 844 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( |
845 const base::DictionaryValue* print_system_settings) { | 845 const base::DictionaryValue* print_system_settings) { |
846 return new PrintSystemWin; | 846 return new PrintSystemWin; |
847 } | 847 } |
848 | 848 |
849 } // namespace cloud_print | 849 } // namespace cloud_print |
OLD | NEW |