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

Side by Side Diff: chrome/browser/printing/print_dialog_gtk.cc

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/resources/print_preview/copies_settings.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/printing/print_dialog_gtk.h" 5 #include "chrome/browser/printing/print_dialog_gtk.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <gtk/gtkpagesetupunixdialog.h> 8 #include <gtk/gtkpagesetupunixdialog.h>
9 #include <gtk/gtkprintjob.h> 9 #include <gtk/gtkprintjob.h>
10 #include <sys/stat.h> 10 #include <sys/stat.h>
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 break; 193 break;
194 case printing::CMYK: 194 case printing::CMYK:
195 color_mode = kCMYK; 195 color_mode = kCMYK;
196 break; 196 break;
197 default: 197 default:
198 color_mode = kGrayscale; 198 color_mode = kGrayscale;
199 break; 199 break;
200 } 200 }
201 gtk_print_settings_set(gtk_settings_, kCUPSColorModel, color_mode); 201 gtk_print_settings_set(gtk_settings_, kCUPSColorModel, color_mode);
202 202
203 if (duplex_mode != printing::UNKNOWN_DUPLEX_MODE) { 203 const char* cups_duplex_mode;
204 const char* cups_duplex_mode; 204 switch (duplex_mode) {
205 switch (duplex_mode) { 205 case printing::LONG_EDGE:
206 case printing::LONG_EDGE: 206 cups_duplex_mode = kDuplexNoTumble;
207 cups_duplex_mode = kDuplexNoTumble; 207 break;
208 break; 208 case printing::SHORT_EDGE:
209 case printing::SHORT_EDGE: 209 cups_duplex_mode = kDuplexTumble;
210 cups_duplex_mode = kDuplexTumble; 210 break;
211 break; 211 default:
212 case printing::SIMPLEX: 212 cups_duplex_mode = kDuplexNone;
213 cups_duplex_mode = kDuplexNone; 213 break;
214 break;
215 default: // UNKNOWN_DUPLEX_MODE
216 NOTREACHED();
217 break;
218 }
219 gtk_print_settings_set(gtk_settings_, kCUPSDuplex, cups_duplex_mode);
220 } 214 }
215 gtk_print_settings_set(gtk_settings_, kCUPSDuplex, cups_duplex_mode);
221 } 216 }
222 217
223 gtk_print_settings_set_orientation( 218 gtk_print_settings_set_orientation(
224 gtk_settings_, 219 gtk_settings_,
225 landscape ? GTK_PAGE_ORIENTATION_LANDSCAPE : 220 landscape ? GTK_PAGE_ORIENTATION_LANDSCAPE :
226 GTK_PAGE_ORIENTATION_PORTRAIT); 221 GTK_PAGE_ORIENTATION_PORTRAIT);
227 222
228 InitPrintSettings(ranges); 223 InitPrintSettings(ranges);
229 return true; 224 return true;
230 } 225 }
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 // Printing finished. Matches AddRef() in PrintDocument(); 394 // Printing finished. Matches AddRef() in PrintDocument();
400 Release(); 395 Release();
401 } 396 }
402 397
403 void PrintDialogGtk::InitPrintSettings(const PageRanges& page_ranges) { 398 void PrintDialogGtk::InitPrintSettings(const PageRanges& page_ranges) {
404 PrintSettings settings; 399 PrintSettings settings;
405 printing::PrintSettingsInitializerGtk::InitPrintSettings( 400 printing::PrintSettingsInitializerGtk::InitPrintSettings(
406 gtk_settings_, page_setup_, page_ranges, false, &settings); 401 gtk_settings_, page_setup_, page_ranges, false, &settings);
407 context_->InitWithSettings(settings); 402 context_->InitWithSettings(settings);
408 } 403 }
OLDNEW
« 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