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

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

Issue 7828106: Revert 100233 - PrintPreview: Added code to identify the printer default duplex value. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 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/copies_settings.js
===================================================================
--- chrome/browser/resources/print_preview/copies_settings.js (revision 100233)
+++ chrome/browser/resources/print_preview/copies_settings.js (working copy)
@@ -22,13 +22,6 @@
this.collateCheckbox_ = $('collate');
this.hint_ = $('copies-hint');
this.twoSidedCheckbox_ = $('two-sided');
- this.twoSidedOption_ = $('two-sided-div');
-
- // Constant values matches printing::DuplexMode enum. Not using const
- // keyword because it is not allowed by JS strict mode.
- this.SIMPLEX = 0;
- this.LONG_EDGE = 1;
- this.UNKNOWN_DUPLEX_MODE = -1;
}
cr.addSingletonGetter(CopiesSettings);
@@ -63,16 +56,15 @@
},
/**
- * Gets the duplex mode information for printing.
+ * Gets the duplex mode for printing.
* @return {number} duplex mode.
*/
- get duplexMode() {
- if (this.twoSidedOption_.hidden)
- return this.UNKNOWN_DUPLEX_MODE;
- else if (this.twoSidedCheckbox_.checked)
- return this.LONG_EDGE;
- else
- return this.SIMPLEX;
+ get duplexMode() {
+ // Constant values matches printing::DuplexMode enum. Not using const
+ // keyword because it is not allowed by JS strict mode.
+ var SIMPLEX = 0;
+ var LONG_EDGE = 1;
+ return !this.twoSidedCheckbox_.checked ? SIMPLEX : LONG_EDGE;
},
/**
@@ -166,8 +158,7 @@
fadeInElement(this.copiesOption_);
$('hr-before-copies').classList.add('invisible');
}
- this.updateTwoSidedOption_(
- e.printerCapabilities.printerDefaultDuplexValue);
+ this.twoSidedCheckbox_.checked = e.printerCapabilities.setDuplexAsDefault;
},
/**
@@ -199,25 +190,6 @@
this.collateOption_.hidden);
},
- /*
- * Takes care of showing/hiding the two sided option and also updates the
- * default state of the checkbox.
- * @param {number} defaultDuplexValue Specifies the default duplex value.
- * @private
- */
- updateTwoSidedOption_: function(defaultDuplexValue) {
- // On Windows, some printers don't specify their duplex values in the
- // printer schema. If the printer duplex value is UNKNOWN_DUPLEX_MODE,
- // hide the two sided option in preview tab UI.
- // Ref bug: http://crbug.com/89204
- this.twoSidedOption_.hidden =
- (defaultDuplexValue == this.UNKNOWN_DUPLEX_MODE);
- this.twoSidedOption_.setAttribute('aria-hidden',
- this.twoSidedOption_.hidden);
- if (!this.twoSidedOption_.hidden)
- this.twoSidedCheckbox_.checked = !!defaultDuplexValue;
- },
-
/**
* Updates the state of the increment/decrement buttons based on the current
* |textfield_| value.
« no previous file with comments | « chrome/browser/printing/print_dialog_gtk.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