Chromium Code Reviews| 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 dc02ab02855e59682011e5caa80272ad69b8ee2b..0d0688fe8fe4e6e22357b980ee18f3942d3b7594 100644 |
| --- a/chrome/browser/resources/print_preview/color_settings.js |
| +++ b/chrome/browser/resources/print_preview/color_settings.js |
| @@ -16,8 +16,8 @@ cr.define('print_preview', function() { |
| this.bwRadioButton_ = $('bw'); |
| this.GRAY = 1; |
| this.COLOR = 2; |
|
dpapad
2011/10/07 17:04:40
COLOR and GRAY are constants, they dont need to be
kmadhusu
2011/10/10 23:34:26
Done.
|
| - this.CMYK = 3; // cmyk - Cyan, magenta, yellow, black |
| this.printerColorModelForColor_ = this.COLOR; |
| + this.printerColorModelForBlack_ = this.GRAY; |
| } |
| cr.addSingletonGetter(ColorSettings); |
| @@ -44,9 +44,9 @@ cr.define('print_preview', function() { |
| * @return {Number} Returns the printer color space |
|
dpapad
2011/10/07 17:04:40
Nit: s/Number/number. Remove line 43 and "Returns"
kmadhusu
2011/10/10 23:34:26
Done.
|
| */ |
| get colorMode() { |
| - if (this.bwRadioButton_.checked) |
| - return this.GRAY; |
| - return this.printerColorModelForColor_; |
| + return this.bwRadioButton_.checked ? |
| + this.printerColorModelForBlack_: |
| + this.printerColorModelForColor_; |
| }, |
| /** |
| @@ -79,6 +79,12 @@ cr.define('print_preview', function() { |
| var setColorAsDefault = e.printerCapabilities.setColorAsDefault; |
| this.printerColorModelForColor_ = |
| e.printerCapabilities.printerColorModelForColor; |
| + if (e.printerCapabilities.printerColorModelForBlack) { |
| + this.printerColorModelForBlack_ = |
| + e.printerCapabilities.printerColorModelForBlack; |
| + } else { |
| + this.printerColorModelForBlack_ = this.GRAY; |
| + } |
| this.colorRadioButton_.checked = setColorAsDefault; |
| this.bwRadioButton_.checked = !setColorAsDefault; |
| setColor(this.colorRadioButton_.checked); |