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

Side by Side Diff: chrome/service/cloud_print/print_system_win.cc

Issue 2835193007: Revert of clean up printing::Image and printing::Metafile (Closed)
Patch Set: Created 3 years, 7 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
OLDNEW
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 <memory> 7 #include <memory>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 int offset_x = ::GetDeviceCaps(printer_dc_.Get(), PHYSICALOFFSETX); 332 int offset_x = ::GetDeviceCaps(printer_dc_.Get(), PHYSICALOFFSETX);
333 int offset_y = ::GetDeviceCaps(printer_dc_.Get(), PHYSICALOFFSETY); 333 int offset_y = ::GetDeviceCaps(printer_dc_.Get(), PHYSICALOFFSETY);
334 XFORM xform = {0}; 334 XFORM xform = {0};
335 xform.eDx = static_cast<float>(-offset_x); 335 xform.eDx = static_cast<float>(-offset_x);
336 xform.eDy = static_cast<float>(-offset_y); 336 xform.eDy = static_cast<float>(-offset_y);
337 xform.eM11 = xform.eM22 = 1.0f / scale_factor; 337 xform.eM11 = xform.eM22 = 1.0f / scale_factor;
338 SetWorldTransform(printer_dc_.Get(), &xform); 338 SetWorldTransform(printer_dc_.Get(), &xform);
339 } 339 }
340 340
341 // ServiceUtilityProcessHost::Client implementation. 341 // ServiceUtilityProcessHost::Client implementation.
342 bool OnRenderPDFPagesToMetafilePageDone(const std::vector<char>& emf_data, 342 void OnRenderPDFPagesToMetafilePageDone(
343 float scale_factor) override { 343 float scale_factor,
344 printing::Emf emf; 344 const printing::MetafilePlayer& emf) override {
345 if (!emf.InitFromData(emf_data.data(), emf_data.size())) {
346 return false;
347 }
348 PreparePageDCForPrinting(printer_dc_.Get(), scale_factor); 345 PreparePageDCForPrinting(printer_dc_.Get(), scale_factor);
349 ::StartPage(printer_dc_.Get()); 346 ::StartPage(printer_dc_.Get());
350 emf.SafePlayback(printer_dc_.Get()); 347 emf.SafePlayback(printer_dc_.Get());
351 ::EndPage(printer_dc_.Get()); 348 ::EndPage(printer_dc_.Get());
352 return true;
353 } 349 }
354 350
355 // ServiceUtilityProcessHost::Client implementation. 351 // ServiceUtilityProcessHost::Client implementation.
356 void OnRenderPDFPagesToMetafileDone(bool success) override { 352 void OnRenderPDFPagesToMetafileDone(bool success) override {
357 PrintJobDone(success); 353 PrintJobDone(success);
358 } 354 }
359 355
360 void OnChildDied() override { PrintJobDone(false); } 356 void OnChildDied() override { PrintJobDone(false); }
361 357
362 // base::win::ObjectWatcher::Delegate implementation. 358 // base::win::ObjectWatcher::Delegate implementation.
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 } 834 }
839 835
840 } // namespace 836 } // namespace
841 837
842 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( 838 scoped_refptr<PrintSystem> PrintSystem::CreateInstance(
843 const base::DictionaryValue* print_system_settings) { 839 const base::DictionaryValue* print_system_settings) {
844 return new PrintSystemWin; 840 return new PrintSystemWin;
845 } 841 }
846 842
847 } // namespace cloud_print 843 } // namespace cloud_print
OLDNEW
« no previous file with comments | « chrome/browser/printing/printing_layout_browsertest.cc ('k') | chrome/service/service_utility_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698