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

Unified Diff: printing/printing_context_mac.mm

Issue 7826040: PrintPreview: Fixed RICOH MP C3501 color print job issues. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nits Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « printing/printing_context_mac.h ('k') | printing/printing_context_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/printing_context_mac.mm
diff --git a/printing/printing_context_mac.mm b/printing/printing_context_mac.mm
index f839802bd3ea7f7993aedad19aab022c7395ae35..8ba4db811d283de9a459c03f1f758aed5df8db1a 100644
--- a/printing/printing_context_mac.mm
+++ b/printing/printing_context_mac.mm
@@ -17,6 +17,7 @@
static const CFStringRef kColorModel = CFSTR("ColorModel");
static const CFStringRef kGrayColor = CFSTR("Gray");
+static const CFStringRef kCMYK = CFSTR("CMYK");
namespace printing {
@@ -107,7 +108,7 @@ PrintingContext::Result PrintingContextMac::UpdatePrinterSettings(
print_info_.reset([[NSPrintInfo sharedPrintInfo] copy]);
bool collate;
- bool color;
+ int color;
bool landscape;
bool print_to_pdf;
int copies;
@@ -116,7 +117,7 @@ PrintingContext::Result PrintingContextMac::UpdatePrinterSettings(
if (!job_settings.GetBoolean(kSettingLandscape, &landscape) ||
!job_settings.GetBoolean(kSettingCollate, &collate) ||
- !job_settings.GetBoolean(kSettingColor, &color) ||
+ !job_settings.GetInteger(kSettingColor, &color) ||
!job_settings.GetBoolean(kSettingPrintToPDF, &print_to_pdf) ||
!job_settings.GetInteger(kSettingDuplexMode, &duplex_mode) ||
!job_settings.GetInteger(kSettingCopies, &copies) ||
@@ -141,7 +142,7 @@ PrintingContext::Result PrintingContextMac::UpdatePrinterSettings(
return OnError();
}
- if (!SetOutputIsColor(color))
+ if (!SetOutputColor(color))
return OnError();
}
@@ -245,10 +246,14 @@ bool PrintingContextMac::SetDuplexModeInPrintSettings(DuplexMode mode) {
return PMSetDuplex(pmPrintSettings, duplexSetting) == noErr;
}
-bool PrintingContextMac::SetOutputIsColor(bool color) {
+bool PrintingContextMac::SetOutputColor(int color_mode) {
PMPrintSettings pmPrintSettings =
static_cast<PMPrintSettings>([print_info_.get() PMPrintSettings]);
- CFStringRef output_color = color ? NULL : kGrayColor;
+ CFStringRef output_color = NULL;
+ if (color_mode == printing::GRAY)
+ output_color = kGrayColor;
+ else if (color_mode == printing::CMYK)
+ output_color = kCMYK;
return PMPrintSettingsSetValue(pmPrintSettings,
kColorModel,
« no previous file with comments | « printing/printing_context_mac.h ('k') | printing/printing_context_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698