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

Side by Side Diff: chrome/service/service_utility_process_host.cc

Issue 2114583002: Windows: Make it possible to print text with GDI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again, resolve conflicts 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
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/service_utility_process_host.h" 5 #include "chrome/service/service_utility_process_host.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <queue> 9 #include <queue>
10 #include <utility> 10 #include <utility>
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 explicit PdfToEmfState(ServiceUtilityProcessHost* host) 92 explicit PdfToEmfState(ServiceUtilityProcessHost* host)
93 : host_(host), page_count_(0), current_page_(0), pages_in_progress_(0) {} 93 : host_(host), page_count_(0), current_page_(0), pages_in_progress_(0) {}
94 ~PdfToEmfState() { Stop(); } 94 ~PdfToEmfState() { Stop(); }
95 95
96 bool Start(base::File pdf_file, 96 bool Start(base::File pdf_file,
97 const printing::PdfRenderSettings& conversion_settings) { 97 const printing::PdfRenderSettings& conversion_settings) {
98 if (!temp_dir_.CreateUniqueTempDir()) 98 if (!temp_dir_.CreateUniqueTempDir())
99 return false; 99 return false;
100 return host_->Send(new ChromeUtilityMsg_RenderPDFPagesToMetafiles( 100 return host_->Send(new ChromeUtilityMsg_RenderPDFPagesToMetafiles(
101 IPC::TakePlatformFileForTransit(std::move(pdf_file)), 101 IPC::TakePlatformFileForTransit(std::move(pdf_file)),
102 conversion_settings)); 102 conversion_settings, false /* print_text_with_gdi */));
103 } 103 }
104 104
105 void GetMorePages() { 105 void GetMorePages() {
106 const int kMaxNumberOfTempFilesPerDocument = 3; 106 const int kMaxNumberOfTempFilesPerDocument = 3;
107 while (pages_in_progress_ < kMaxNumberOfTempFilesPerDocument && 107 while (pages_in_progress_ < kMaxNumberOfTempFilesPerDocument &&
108 current_page_ < page_count_) { 108 current_page_ < page_count_) {
109 ++pages_in_progress_; 109 ++pages_in_progress_;
110 emf_files_.push(CreateTempFile()); 110 emf_files_.push(CreateTempFile());
111 host_->Send(new ChromeUtilityMsg_RenderPDFPagesToMetafiles_GetPage( 111 host_->Send(new ChromeUtilityMsg_RenderPDFPagesToMetafiles_GetPage(
112 current_page_++, 112 current_page_++,
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 return false; 457 return false;
458 } 458 }
459 printing::Emf emf; 459 printing::Emf emf;
460 if (!emf.InitFromData(data.data(), data.size())) { 460 if (!emf.InitFromData(data.data(), data.size())) {
461 OnRenderPDFPagesToMetafileDone(false); 461 OnRenderPDFPagesToMetafileDone(false);
462 return false; 462 return false;
463 } 463 }
464 OnRenderPDFPagesToMetafilePageDone(scale_factor, emf); 464 OnRenderPDFPagesToMetafilePageDone(scale_factor, emf);
465 return true; 465 return true;
466 } 466 }
OLDNEW
« no previous file with comments | « chrome/common/chrome_utility_printing_messages.h ('k') | chrome/utility/chrome_content_utility_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698