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

Unified Diff: chrome/utility/printing_handler.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, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/utility/printing_handler.h ('k') | components/printing/common/print_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/printing_handler.cc
diff --git a/chrome/utility/printing_handler.cc b/chrome/utility/printing_handler.cc
index e396492511f1ed04faa0dbe05cac33213899ce84..3d251dce312b9a9c706d39024da6162d70232c52 100644
--- a/chrome/utility/printing_handler.cc
+++ b/chrome/utility/printing_handler.cc
@@ -40,9 +40,22 @@ void ReleaseProcessIfNeeded() {
content::UtilityThread::Get()->ReleaseProcessIfNeeded();
}
+#if defined(OS_WIN)
+void PreCacheFontCharacters(const LOGFONT* logfont,
+ const wchar_t* text,
+ size_t text_length) {
+ Send(new ChromeUtilityHostMsg_PreCacheFontCharacters(
+ *logfont, base::string16(text, text_length)));
+}
+#endif
+
} // namespace
-PrintingHandler::PrintingHandler() {}
+PrintingHandler::PrintingHandler() {
+#if defined(OS_WIN)
+ chrome_pdf::SetPDFEnsureTypefaceCharactersAccessible(PreCacheFontCharacters);
+#endif
+}
PrintingHandler::~PrintingHandler() {}
@@ -73,8 +86,10 @@ bool PrintingHandler::OnMessageReceived(const IPC::Message& message) {
#if defined(OS_WIN)
void PrintingHandler::OnRenderPDFPagesToMetafile(
IPC::PlatformFileForTransit pdf_transit,
- const PdfRenderSettings& settings) {
+ const PdfRenderSettings& settings,
+ bool print_text_with_gdi) {
pdf_rendering_settings_ = settings;
+ chrome_pdf::SetPDFUseGDIPrinting(print_text_with_gdi);
base::File pdf_file = IPC::PlatformFileForTransitToFile(pdf_transit);
int page_count = LoadPDF(std::move(pdf_file));
Send(
« no previous file with comments | « chrome/utility/printing_handler.h ('k') | components/printing/common/print_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698