Index: chrome/browser/resources/print_preview/color_settings.js |
diff --git a/chrome/browser/resources/print_preview/color_settings.js b/chrome/browser/resources/print_preview/color_settings.js |
index c0547e90ea43ab39f624f49f7b67f88841a6cbfc..6d2ce7e80cfa0c15c9ae581da1c9ef2af50fdbae 100644 |
--- a/chrome/browser/resources/print_preview/color_settings.js |
+++ b/chrome/browser/resources/print_preview/color_settings.js |
@@ -14,6 +14,10 @@ cr.define('print_preview', function() { |
this.colorOption_ = $('color-option'); |
this.colorRadioButton_ = $('color'); |
this.bwRadioButton_ = $('bw'); |
+ this.cmyk_ = 0; |
dpapad
2011/09/02 22:15:06
Since these are supposed to be constants I think i
dpapad
2011/09/02 22:15:06
What is cmyk? Could you document it?
kmadhusu
2011/09/04 01:52:51
Done.
kmadhusu
2011/09/04 01:52:51
Done.
|
+ this.gray_ = 1; |
+ this.color_ = 2; |
+ this.printerColorSpace_ = this.color_; |
vandebo (ex-Chrome)
2011/09/02 22:38:18
Is this the color model used when printing in colo
kmadhusu
2011/09/04 01:52:51
printerColorSpace_ => printerColorModelForColor
|
} |
cr.addSingletonGetter(ColorSettings); |
@@ -37,10 +41,17 @@ cr.define('print_preview', function() { |
/** |
* Checks whether |this.colorRadioButton_| is checked. |
- * @return {boolean} true if |this.colorRadioButton_| is checked. |
+ * @return {Number} Returns the printer color space |
dpapad
2011/09/02 22:15:06
Nit: "Returns" is redundant.
kmadhusu
2011/09/04 01:52:51
Done.
|
*/ |
- isColor: function() { |
- return this.colorRadioButton_.checked; |
+ getColorMode: function() { |
dpapad
2011/09/02 22:15:06
Could you use the get syntax like above?
kmadhusu
2011/09/04 01:52:51
Done.
|
+ if (this.bwRadioButton_.checked) |
+ return this.gray_; |
+ |
+ if (this.printerColorSpace_ == this.color_) |
vandebo (ex-Chrome)
2011/09/02 22:38:18
Can you just return this.printerColorSpace_ ?
kmadhusu
2011/09/04 01:52:51
oops.. Fixed. Good catch.
|
+ return this.color_; |
+ else if (this.printerColorSpace_ == this.cmyk_) |
+ return this.cmyk_; |
+ return this.gray_; |
}, |
/** |
@@ -71,6 +82,7 @@ cr.define('print_preview', function() { |
this.colorOption_.setAttribute('aria-hidden', disableColorOption); |
var setColorAsDefault = e.printerCapabilities.setColorAsDefault; |
+ this.printerColorSpace_ = e.printerCapabilities.printerColorSpace; |
this.colorRadioButton_.checked = setColorAsDefault; |
this.bwRadioButton_.checked = !setColorAsDefault; |
setColor(this.colorRadioButton_.checked); |