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

Unified Diff: printing/printing_context_mac.mm

Issue 8245012: Revert 105087 - PrintPreview: Fix printer color settings issues based on printer ppd/schema infor... (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
===================================================================
--- printing/printing_context_mac.mm (revision 105095)
+++ printing/printing_context_mac.mm (working copy)
@@ -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::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;
}
Property changes on: printing/printing_context_mac.mm
___________________________________________________________________
Added: svn:mergeinfo
« 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