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

Unified Diff: chrome/browser/resources/print_preview/color_settings.js

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
Index: chrome/browser/resources/print_preview/color_settings.js
===================================================================
--- chrome/browser/resources/print_preview/color_settings.js (revision 105094)
+++ chrome/browser/resources/print_preview/color_settings.js (working copy)
@@ -14,13 +14,12 @@
this.colorOption_ = $('color-option');
this.colorRadioButton_ = $('color');
this.bwRadioButton_ = $('bw');
-
- this.printerColorModelForColor_ = ColorSettings.COLOR;
- this.printerColorModelForBlack_ = ColorSettings.GRAY;
+ this.GRAY = 1;
+ this.COLOR = 2;
+ this.CMYK = 3; // cmyk - Cyan, magenta, yellow, black
+ this.printerColorModelForColor_ = this.COLOR;
}
- ColorSettings.GRAY = 1;
- ColorSettings.COLOR = 2;
cr.addSingletonGetter(ColorSettings);
ColorSettings.prototype = {
@@ -41,12 +40,13 @@
},
/**
- * @return {number} The color mode for print preview.
+ * Returns the color mode for print preview.
+ * @return {Number} Returns the printer color space
*/
get colorMode() {
- return this.bwRadioButton_.checked ?
- this.printerColorModelForBlack_:
- this.printerColorModelForColor_;
+ if (this.bwRadioButton_.checked)
+ return this.GRAY;
+ return this.printerColorModelForColor_;
},
/**
@@ -79,19 +79,13 @@
var setColorAsDefault = e.printerCapabilities.setColorAsDefault;
this.printerColorModelForColor_ =
e.printerCapabilities.printerColorModelForColor;
- if (e.printerCapabilities.printerColorModelForBlack) {
- this.printerColorModelForBlack_ =
- e.printerCapabilities.printerColorModelForBlack;
- } else {
- this.printerColorModelForBlack_ = ColorSettings.GRAY;
- }
this.colorRadioButton_.checked = setColorAsDefault;
this.bwRadioButton_.checked = !setColorAsDefault;
setColor(this.colorRadioButton_.checked);
},
/**
- * Executes when a PDFLoaded event occurs.
+ * Listener executing when a PDFLoaded event occurs.
* @private
*/
onPDFLoaded_: function() {
« no previous file with comments | « chrome/browser/printing/print_system_task_proxy_unittest.cc ('k') | chrome/browser/resources/print_preview/print_preview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698