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

Unified Diff: printing/printing_context_mac.mm

Issue 8226024: Reland 105087: PrintPreview: Fix printer color settings issues based on printer ppd/schema info. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 2 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.cc ('k') | no next file » | 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 15348a0b77c87946460a539b07cb78f23b1767f7..bfb9817942d5bb9d407e39a8025e62b5558d9508 100644
--- a/printing/printing_context_mac.mm
+++ b/printing/printing_context_mac.mm
@@ -15,10 +15,6 @@
#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
@@ -253,15 +249,17 @@ bool PrintingContextMac::SetDuplexModeInPrintSettings(DuplexMode mode) {
bool PrintingContextMac::SetOutputColor(int color_mode) {
PMPrintSettings pmPrintSettings =
static_cast<PMPrintSettings>([print_info_.get() PMPrintSettings]);
- CFStringRef output_color = NULL;
- if (color_mode == printing::GRAY)
- output_color = kGrayColor;
- else if (color_mode == printing::CMYK)
- output_color = kCMYK;
+ 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));
return PMPrintSettingsSetValue(pmPrintSettings,
- kColorModel,
- output_color,
+ color_setting.get(),
+ output_color.get(),
false) == noErr;
}
« no previous file with comments | « printing/print_settings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698