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

Side by Side Diff: printing/printing_context_mac.mm

Issue 7817013: PrintPreview: Added code to identify the printer default duplex value. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed dpapad@ comments. 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 | « printing/print_job_constants.h ('k') | printing/printing_context_win.cc » ('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 "printing/printing_context_mac.h" 5 #include "printing/printing_context_mac.h"
6 6
7 #import <ApplicationServices/ApplicationServices.h> 7 #import <ApplicationServices/ApplicationServices.h>
8 #import <AppKit/AppKit.h> 8 #import <AppKit/AppKit.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 229
230 bool PrintingContextMac::SetDuplexModeInPrintSettings(DuplexMode mode) { 230 bool PrintingContextMac::SetDuplexModeInPrintSettings(DuplexMode mode) {
231 PMDuplexMode duplexSetting; 231 PMDuplexMode duplexSetting;
232 switch (mode) { 232 switch (mode) {
233 case LONG_EDGE: 233 case LONG_EDGE:
234 duplexSetting = kPMDuplexNoTumble; 234 duplexSetting = kPMDuplexNoTumble;
235 break; 235 break;
236 case SHORT_EDGE: 236 case SHORT_EDGE:
237 duplexSetting = kPMDuplexTumble; 237 duplexSetting = kPMDuplexTumble;
238 break; 238 break;
239 default: 239 case SIMPLEX:
240 duplexSetting = kPMDuplexNone; 240 duplexSetting = kPMDuplexNone;
241 break; 241 break;
242 default: // UNKNOWN_DUPLEX_MODE
243 return true;
242 } 244 }
243 245
244 PMPrintSettings pmPrintSettings = 246 PMPrintSettings pmPrintSettings =
245 static_cast<PMPrintSettings>([print_info_.get() PMPrintSettings]); 247 static_cast<PMPrintSettings>([print_info_.get() PMPrintSettings]);
246 return PMSetDuplex(pmPrintSettings, duplexSetting) == noErr; 248 return PMSetDuplex(pmPrintSettings, duplexSetting) == noErr;
247 } 249 }
248 250
249 bool PrintingContextMac::SetOutputColor(int color_mode) { 251 bool PrintingContextMac::SetOutputColor(int color_mode) {
250 PMPrintSettings pmPrintSettings = 252 PMPrintSettings pmPrintSettings =
251 static_cast<PMPrintSettings>([print_info_.get() PMPrintSettings]); 253 static_cast<PMPrintSettings>([print_info_.get() PMPrintSettings]);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 void PrintingContextMac::ReleaseContext() { 377 void PrintingContextMac::ReleaseContext() {
376 print_info_.reset(); 378 print_info_.reset();
377 context_ = NULL; 379 context_ = NULL;
378 } 380 }
379 381
380 gfx::NativeDrawingContext PrintingContextMac::context() const { 382 gfx::NativeDrawingContext PrintingContextMac::context() const {
381 return context_; 383 return context_;
382 } 384 }
383 385
384 } // namespace printing 386 } // namespace printing
OLDNEW
« no previous file with comments | « printing/print_job_constants.h ('k') | printing/printing_context_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698