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

Unified Diff: chrome/browser/printing/print_dialog_gtk.cc

Issue 7859007: Reland 100233 PrintPreview: Added code to identify the printer default duplex value. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initialize cups_duplex_mode in print_dialog_gtk.cc 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
« no previous file with comments | « no previous file | chrome/browser/resources/print_preview/copies_settings.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ccdd07b7a038d26f0a07354ff54fbf560d8f4fce 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 = NULL;
+ 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(
« no previous file with comments | « no previous file | chrome/browser/resources/print_preview/copies_settings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698