diff options
author | kmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-12 16:43:56 +0000 |
---|---|---|
committer | kmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-12 16:43:56 +0000 |
commit | 540fead9ca2d4c454b7e3461b59f64c911155c6c (patch) | |
tree | 6180cbf97febce531dacb5bd69aea6f608d8be54 /printing/printing_context_mac.mm | |
parent | 8f8146f2af6da72ea93020727f2c712baa71f73b (diff) | |
download | chromium_src-540fead9ca2d4c454b7e3461b59f64c911155c6c.zip chromium_src-540fead9ca2d4c454b7e3461b59f64c911155c6c.tar.gz chromium_src-540fead9ca2d4c454b7e3461b59f64c911155c6c.tar.bz2 |
Revert 105087 - PrintPreview: Fix printer color settings issues based on printer ppd/schema information.
Show/Hide the color options based on printer ppd/schema information. Some printers does not provide sufficient information in the printer schema/ppd regarding the color settings and they use custom advance settings to print in black & white/greyscale. In those cases, users need to print using native dialog in order to set these advance color settings.
BUG=93811, 93490, 87344, 96658, 98768
TEST= Please refer to bug description.
Review URL: http://codereview.chromium.org/8138020
TBR=kmadhusu@chromium.org
Review URL: http://codereview.chromium.org/8245012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105096 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/printing_context_mac.mm')
-rw-r--r-- | printing/printing_context_mac.mm | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/printing/printing_context_mac.mm b/printing/printing_context_mac.mm index bfb9817..15348a0 100644 --- a/printing/printing_context_mac.mm +++ b/printing/printing_context_mac.mm @@ -15,6 +15,10 @@ #include "base/values.h" #include "printing/print_settings_initializer_mac.h" +static const CFStringRef kColorModel = CFSTR("ColorModel"); +static const CFStringRef kGrayColor = CFSTR("Gray"); +static const CFStringRef kCMYK = CFSTR("CMYK"); + namespace printing { // static @@ -249,17 +253,15 @@ bool PrintingContextMac::SetDuplexModeInPrintSettings(DuplexMode mode) { bool PrintingContextMac::SetOutputColor(int color_mode) { PMPrintSettings pmPrintSettings = static_cast<PMPrintSettings>([print_info_.get() PMPrintSettings]); - std::string color_setting_name; - std::string color_value; - printing::GetColorModelForMode(color_mode, &color_setting_name, &color_value); - base::mac::ScopedCFTypeRef<CFStringRef> color_setting( - base::SysUTF8ToCFStringRef(color_setting_name)); - base::mac::ScopedCFTypeRef<CFStringRef> output_color( - base::SysUTF8ToCFStringRef(color_value)); + CFStringRef output_color = NULL; + if (color_mode == printing::GRAY) + output_color = kGrayColor; + else if (color_mode == printing::CMYK) + output_color = kCMYK; return PMPrintSettingsSetValue(pmPrintSettings, - color_setting.get(), - output_color.get(), + kColorModel, + output_color, false) == noErr; } |