Skip to content

Commit

Permalink
Reland 105087: PrintPreview: Fix printer color settings issues based …
Browse files Browse the repository at this point in the history
…on printer ppd/schema info.

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


Review URL: http://codereview.chromium.org/8226024

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105217 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
kmadhusu@chromium.org committed Oct 13, 2011
1 parent 611b6f6 commit 63313ae
Show file tree
Hide file tree
Showing 15 changed files with 832 additions and 408 deletions.
24 changes: 5 additions & 19 deletions chrome/browser/printing/print_dialog_gtk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ using printing::PrintSettings;

namespace {

// CUPS ColorModel attribute and values.
const char kCMYK[] = "CMYK";
const char kCUPSColorModel[] = "cups-ColorModel";
const char kColor[] = "Color";
const char kGrayscale[] = "Grayscale";

// CUPS Duplex attribute and values.
const char kCUPSDuplex[] = "cups-Duplex";
const char kDuplexNone[] = "None";
Expand Down Expand Up @@ -193,19 +187,11 @@ bool PrintDialogGtk::UpdateSettings(const DictionaryValue& settings,
gtk_print_settings_set_n_copies(gtk_settings_, copies);
gtk_print_settings_set_collate(gtk_settings_, collate);

const char* color_mode;
switch (color) {
case printing::COLOR:
color_mode = kColor;
break;
case printing::CMYK:
color_mode = kCMYK;
break;
default:
color_mode = kGrayscale;
break;
}
gtk_print_settings_set(gtk_settings_, kCUPSColorModel, color_mode);
std::string color_value;
std::string color_setting_name;
printing::GetColorModelForMode(color, &color_setting_name, &color_value);
gtk_print_settings_set(gtk_settings_, color_setting_name.c_str(),
color_value.c_str());

if (duplex_mode != printing::UNKNOWN_DUPLEX_MODE) {
const char* cups_duplex_mode = NULL;
Expand Down
Loading

0 comments on commit 63313ae

Please sign in to comment.