| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |