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 <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
8 | 8 |
9 #import <iomanip> | 9 #import <iomanip> |
10 #import <numeric> | 10 #import <numeric> |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 162 |
163 print_info_.reset([[NSPrintInfo sharedPrintInfo] copy]); | 163 print_info_.reset([[NSPrintInfo sharedPrintInfo] copy]); |
164 settings_.set_ranges(GetPageRangesFromPrintInfo()); | 164 settings_.set_ranges(GetPageRangesFromPrintInfo()); |
165 InitPrintSettingsFromPrintInfo(); | 165 InitPrintSettingsFromPrintInfo(); |
166 | 166 |
167 return OK; | 167 return OK; |
168 } | 168 } |
169 | 169 |
170 PrintingContext::Result PrintingContextMac::UpdatePrinterSettings( | 170 PrintingContext::Result PrintingContextMac::UpdatePrinterSettings( |
171 bool external_preview, | 171 bool external_preview, |
172 bool show_system_dialog) { | 172 bool show_system_dialog, |
| 173 int page_count) { |
173 DCHECK(!show_system_dialog); | 174 DCHECK(!show_system_dialog); |
174 DCHECK(!in_print_job_); | 175 DCHECK(!in_print_job_); |
175 | 176 |
176 // NOTE: Reset |print_info_| with a copy of |sharedPrintInfo| so as to start | 177 // NOTE: Reset |print_info_| with a copy of |sharedPrintInfo| so as to start |
177 // with a clean slate. | 178 // with a clean slate. |
178 print_info_.reset([[NSPrintInfo sharedPrintInfo] copy]); | 179 print_info_.reset([[NSPrintInfo sharedPrintInfo] copy]); |
179 | 180 |
180 if (external_preview) { | 181 if (external_preview) { |
181 if (!SetPrintPreviewJob()) | 182 if (!SetPrintPreviewJob()) |
182 return OnError(); | 183 return OnError(); |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 void PrintingContextMac::ReleaseContext() { | 519 void PrintingContextMac::ReleaseContext() { |
519 print_info_.reset(); | 520 print_info_.reset(); |
520 context_ = NULL; | 521 context_ = NULL; |
521 } | 522 } |
522 | 523 |
523 gfx::NativeDrawingContext PrintingContextMac::context() const { | 524 gfx::NativeDrawingContext PrintingContextMac::context() const { |
524 return context_; | 525 return context_; |
525 } | 526 } |
526 | 527 |
527 } // namespace printing | 528 } // namespace printing |
OLD | NEW |