Commit 2e41a5fe authored by rltoscano@google.com's avatar rltoscano@google.com

Fix duplex defaults.


BUG=138312


Review URL: https://chromiumcodereview.appspot.com/10829229

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150482 0039d316-1c4b-4281-b951-d872f2087c98
parent d9ee5a98
......@@ -49,9 +49,7 @@ cr.define('print_preview', function() {
if (hasDuplexCapability =
settingsInfo['printerDefaultDuplexValue'] !=
print_preview.NativeLayer.DuplexMode.UNKNOWN_DUPLEX_MODE) {
defaultIsDuplexEnabled =
settingsInfo['printerDefaultDuplexValue'] ==
print_preview.NativeLayer.DuplexMode.LONG_EDGE;
defaultIsDuplexEnabled = settingsInfo['setDuplexAsDefault'] || false;
}
return new print_preview.ChromiumCapabilities(
......
......@@ -634,7 +634,10 @@ cr.define('print_preview', function() {
if (isFirstUpdate) {
cr.dispatchSimpleEvent(this, PrintTicketStore.EventType.INITIALIZE);
} else {
// Reset user selection for certain ticket items.
this.duplex_.updateValue(null);
this.customMargins_.updateValue(null);
if (this.marginsType_.getValue() ==
print_preview.ticket_items.MarginsType.Value.CUSTOM) {
this.marginsType_.updateValue(
......
......@@ -648,7 +648,8 @@ TEST_F('PrintPreviewWebUITest', 'TestDuplexSettings', function() {
'setColorAsDefault': true,
'disableCopiesOption': false,
'disableLandscapeOption': true,
'printerDefaultDuplexValue': 0
'printerDefaultDuplexValue': 0,
'setDuplexAsDefault': false
};
this.nativeLayer_.dispatchEvent(capsSetEvent);
......@@ -681,7 +682,8 @@ TEST_F('PrintPreviewWebUITest', 'TestDuplexSettings', function() {
'setColorAsDefault': false,
'disableCopiesOption': false,
'disableLandscapeOption': false,
'printerDefaultDuplexValue': 1
'printerDefaultDuplexValue': 1,
'setDuplexAsDefault': true
};
this.nativeLayer_.dispatchEvent(capsSetEvent);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment