0

PrintPreview: Added code to honor the grayscale color model.

BUG=None
TEST=Add a printer which supports grayscale and cmyk color models. Preview a
color webpage. Observe that the color options is displayed to the user.


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105528 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
kmadhusu@chromium.org
2011-10-14 18:27:35 +00:00
parent af429e26b1
commit a3ee735fe9
3 changed files with 9 additions and 2 deletions
chrome/browser
printing
resources
print_preview
printing

@ -148,6 +148,8 @@ bool getBasicColorModelSettings(
*color_model_for_black = printing::BLACK;
else if (ppdFindChoice(color_model, printing::kGray))
*color_model_for_black = printing::GRAY;
else if (ppdFindChoice(color_model, printing::kGrayscale))
*color_model_for_black = printing::GRAYSCALE;
if (ppdFindChoice(color_model, printing::kColor))
*color_model_for_color = printing::COLOR;

@ -77,8 +77,12 @@ cr.define('print_preview', function() {
this.colorOption_.setAttribute('aria-hidden', disableColorOption);
var setColorAsDefault = e.printerCapabilities.setColorAsDefault;
this.printerColorModelForColor_ =
e.printerCapabilities.printerColorModelForColor;
if (e.printerCapabilities.printerColorModelForColor) {
this.printerColorModelForColor_ =
e.printerCapabilities.printerColorModelForColor;
} else {
this.printerColorModelForColor_ = ColorSettings.COLOR;
}
if (e.printerCapabilities.printerColorModelForBlack) {
this.printerColorModelForBlack_ =
e.printerCapabilities.printerColorModelForBlack;

@ -98,6 +98,7 @@ enum ColorModels {
KCMY,
CMY_K, // CMY_K represents CMY+K.
BLACK,
GRAYSCALE,
RGB,
RGB16,
RGBA,