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

Unified Diff: printing/print_settings_initializer_win.cc

Issue 2970473002: Add generic text printing (Closed)
Patch Set: Change enum names Created 3 years, 5 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 | « printing/print_settings.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/print_settings_initializer_win.cc
diff --git a/printing/print_settings_initializer_win.cc b/printing/print_settings_initializer_win.cc
index e611e844cedc728724640e42acbe7a7aa99c83e7..fd243fe6109b618ea6fd2bb47efb4949eb5671a4 100644
--- a/printing/print_settings_initializer_win.cc
+++ b/printing/print_settings_initializer_win.cc
@@ -92,6 +92,9 @@ bool IsPrinterXPS(HDC hdc) {
return IsTechnology(hdc, kXPSDriver);
}
+bool IsPrinterTextOnly(HDC hdc) {
+ return ::GetDeviceCaps(hdc, TECHNOLOGY) == DT_CHARSTREAM;
+}
} // namespace
// static
@@ -153,6 +156,11 @@ void PrintSettingsInitializerWin::InitPrintSettings(
PrintSettings::PrinterType::TYPE_POSTSCRIPT_LEVEL3);
return;
}
+ // Detects the generic / text only driver.
+ if (IsPrinterTextOnly(hdc)) {
+ print_settings->set_printer_type(PrintSettings::PrinterType::TYPE_TEXTONLY);
+ return;
+ }
if (IsPrinterXPS(hdc)) {
print_settings->set_printer_type(PrintSettings::PrinterType::TYPE_XPS);
return;
« no previous file with comments | « printing/print_settings.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698