Index: chrome/browser/printing/print_dialog_gtk.cc |
diff --git a/chrome/browser/printing/print_dialog_gtk.cc b/chrome/browser/printing/print_dialog_gtk.cc |
index 4c3bb828199fc00e5a1fcc8616b5fcd6c3ddadd2..dd31d37467a08b5038ee82fe27619c024f45e956 100644 |
--- a/chrome/browser/printing/print_dialog_gtk.cc |
+++ b/chrome/browser/printing/print_dialog_gtk.cc |
@@ -200,19 +200,24 @@ bool PrintDialogGtk::UpdateSettings(const DictionaryValue& settings, |
} |
gtk_print_settings_set(gtk_settings_, kCUPSColorModel, color_mode); |
- const char* cups_duplex_mode; |
- switch (duplex_mode) { |
- case printing::LONG_EDGE: |
- cups_duplex_mode = kDuplexNoTumble; |
- break; |
- case printing::SHORT_EDGE: |
- cups_duplex_mode = kDuplexTumble; |
- break; |
- default: |
- cups_duplex_mode = kDuplexNone; |
- break; |
+ if (duplex_mode != printing::UNKNOWN_DUPLEX_MODE) { |
+ const char* cups_duplex_mode; |
+ switch (duplex_mode) { |
+ case printing::LONG_EDGE: |
+ cups_duplex_mode = kDuplexNoTumble; |
+ break; |
+ case printing::SHORT_EDGE: |
+ cups_duplex_mode = kDuplexTumble; |
+ break; |
+ case printing::SIMPLEX: |
+ cups_duplex_mode = kDuplexNone; |
+ break; |
+ default: // UNKNOWN_DUPLEX_MODE |
+ NOTREACHED(); |
+ break; |
+ } |
+ gtk_print_settings_set(gtk_settings_, kCUPSDuplex, cups_duplex_mode); |
} |
- gtk_print_settings_set(gtk_settings_, kCUPSDuplex, cups_duplex_mode); |
} |
gtk_print_settings_set_orientation( |