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() { ...@@ -49,9 +49,7 @@ cr.define('print_preview', function() {
if (hasDuplexCapability = if (hasDuplexCapability =
settingsInfo['printerDefaultDuplexValue'] != settingsInfo['printerDefaultDuplexValue'] !=
print_preview.NativeLayer.DuplexMode.UNKNOWN_DUPLEX_MODE) { print_preview.NativeLayer.DuplexMode.UNKNOWN_DUPLEX_MODE) {
defaultIsDuplexEnabled = defaultIsDuplexEnabled = settingsInfo['setDuplexAsDefault'] || false;
settingsInfo['printerDefaultDuplexValue'] ==
print_preview.NativeLayer.DuplexMode.LONG_EDGE;
} }
return new print_preview.ChromiumCapabilities( return new print_preview.ChromiumCapabilities(
......
...@@ -634,7 +634,10 @@ cr.define('print_preview', function() { ...@@ -634,7 +634,10 @@ cr.define('print_preview', function() {
if (isFirstUpdate) { if (isFirstUpdate) {
cr.dispatchSimpleEvent(this, PrintTicketStore.EventType.INITIALIZE); cr.dispatchSimpleEvent(this, PrintTicketStore.EventType.INITIALIZE);
} else { } else {
// Reset user selection for certain ticket items.
this.duplex_.updateValue(null);
this.customMargins_.updateValue(null); this.customMargins_.updateValue(null);
if (this.marginsType_.getValue() == if (this.marginsType_.getValue() ==
print_preview.ticket_items.MarginsType.Value.CUSTOM) { print_preview.ticket_items.MarginsType.Value.CUSTOM) {
this.marginsType_.updateValue( this.marginsType_.updateValue(
......
...@@ -648,7 +648,8 @@ TEST_F('PrintPreviewWebUITest', 'TestDuplexSettings', function() { ...@@ -648,7 +648,8 @@ TEST_F('PrintPreviewWebUITest', 'TestDuplexSettings', function() {
'setColorAsDefault': true, 'setColorAsDefault': true,
'disableCopiesOption': false, 'disableCopiesOption': false,
'disableLandscapeOption': true, 'disableLandscapeOption': true,
'printerDefaultDuplexValue': 0 'printerDefaultDuplexValue': 0,
'setDuplexAsDefault': false
}; };
this.nativeLayer_.dispatchEvent(capsSetEvent); this.nativeLayer_.dispatchEvent(capsSetEvent);
...@@ -681,7 +682,8 @@ TEST_F('PrintPreviewWebUITest', 'TestDuplexSettings', function() { ...@@ -681,7 +682,8 @@ TEST_F('PrintPreviewWebUITest', 'TestDuplexSettings', function() {
'setColorAsDefault': false, 'setColorAsDefault': false,
'disableCopiesOption': false, 'disableCopiesOption': false,
'disableLandscapeOption': false, 'disableLandscapeOption': false,
'printerDefaultDuplexValue': 1 'printerDefaultDuplexValue': 1,
'setDuplexAsDefault': true
}; };
this.nativeLayer_.dispatchEvent(capsSetEvent); 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