| 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 #import <iomanip> | 10 #import <iomanip> |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 // NOTE: Reset |print_info_| with a copy of |sharedPrintInfo| so as to start | 143 // NOTE: Reset |print_info_| with a copy of |sharedPrintInfo| so as to start |
| 144 // with a clean slate. | 144 // with a clean slate. |
| 145 print_info_.reset([[NSPrintInfo sharedPrintInfo] copy]); | 145 print_info_.reset([[NSPrintInfo sharedPrintInfo] copy]); |
| 146 | 146 |
| 147 if (external_preview) { | 147 if (external_preview) { |
| 148 if (!SetPrintPreviewJob()) | 148 if (!SetPrintPreviewJob()) |
| 149 return OnError(); | 149 return OnError(); |
| 150 } else { | 150 } else { |
| 151 // Don't need this for preview. | 151 // Don't need this for preview. |
| 152 if (!SetPrinter(UTF16ToUTF8(settings_.device_name())) || | 152 if (!SetPrinter(base::UTF16ToUTF8(settings_.device_name())) || |
| 153 !SetCopiesInPrintSettings(settings_.copies()) || | 153 !SetCopiesInPrintSettings(settings_.copies()) || |
| 154 !SetCollateInPrintSettings(settings_.collate()) || | 154 !SetCollateInPrintSettings(settings_.collate()) || |
| 155 !SetDuplexModeInPrintSettings(settings_.duplex_mode()) || | 155 !SetDuplexModeInPrintSettings(settings_.duplex_mode()) || |
| 156 !SetOutputColor(settings_.color())) { | 156 !SetOutputColor(settings_.color())) { |
| 157 return OnError(); | 157 return OnError(); |
| 158 } | 158 } |
| 159 } | 159 } |
| 160 | 160 |
| 161 if (!UpdatePageFormatWithPaperInfo() || | 161 if (!UpdatePageFormatWithPaperInfo() || |
| 162 !SetOrientationIsLandscape(settings_.landscape())) { | 162 !SetOrientationIsLandscape(settings_.landscape())) { |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 void PrintingContextMac::ReleaseContext() { | 499 void PrintingContextMac::ReleaseContext() { |
| 500 print_info_.reset(); | 500 print_info_.reset(); |
| 501 context_ = NULL; | 501 context_ = NULL; |
| 502 } | 502 } |
| 503 | 503 |
| 504 gfx::NativeDrawingContext PrintingContextMac::context() const { | 504 gfx::NativeDrawingContext PrintingContextMac::context() const { |
| 505 return context_; | 505 return context_; |
| 506 } | 506 } |
| 507 | 507 |
| 508 } // namespace printing | 508 } // namespace printing |
| OLD | NEW |