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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 xform.eDy = static_cast<float>(-offset_y); | 328 xform.eDy = static_cast<float>(-offset_y); |
329 xform.eM11 = xform.eM22 = 1.0 / scale_factor; | 329 xform.eM11 = xform.eM22 = 1.0 / scale_factor; |
330 SetWorldTransform(printer_dc_.Get(), &xform); | 330 SetWorldTransform(printer_dc_.Get(), &xform); |
331 } | 331 } |
332 | 332 |
333 // ServiceUtilityProcessHost::Client implementation. | 333 // ServiceUtilityProcessHost::Client implementation. |
334 virtual void OnRenderPDFPagesToMetafilePageDone( | 334 virtual void OnRenderPDFPagesToMetafilePageDone( |
335 double scale_factor, | 335 double scale_factor, |
336 const printing::MetafilePlayer& emf) OVERRIDE { | 336 const printing::MetafilePlayer& emf) OVERRIDE { |
337 PreparePageDCForPrinting(printer_dc_.Get(), scale_factor); | 337 PreparePageDCForPrinting(printer_dc_.Get(), scale_factor); |
| 338 ::StartPage(printer_dc_.Get()); |
338 emf.SafePlayback(printer_dc_.Get()); | 339 emf.SafePlayback(printer_dc_.Get()); |
| 340 ::EndPage(printer_dc_.Get()); |
339 } | 341 } |
340 | 342 |
341 // ServiceUtilityProcessHost::Client implementation. | 343 // ServiceUtilityProcessHost::Client implementation. |
342 virtual void OnRenderPDFPagesToMetafileDone(bool success) OVERRIDE { | 344 virtual void OnRenderPDFPagesToMetafileDone(bool success) OVERRIDE { |
343 PrintJobDone(success); | 345 PrintJobDone(success); |
344 } | 346 } |
345 | 347 |
346 virtual void OnChildDied() OVERRIDE { PrintJobDone(false); } | 348 virtual void OnChildDied() OVERRIDE { PrintJobDone(false); } |
347 | 349 |
348 // base::win::ObjectWatcher::Delegate implementation. | 350 // base::win::ObjectWatcher::Delegate implementation. |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 } | 819 } |
818 | 820 |
819 } // namespace | 821 } // namespace |
820 | 822 |
821 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( | 823 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( |
822 const base::DictionaryValue* print_system_settings) { | 824 const base::DictionaryValue* print_system_settings) { |
823 return new PrintSystemWin; | 825 return new PrintSystemWin; |
824 } | 826 } |
825 | 827 |
826 } // namespace cloud_print | 828 } // namespace cloud_print |
OLD | NEW |