| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 PrintingContext::Result PrintingContextMac::UseDefaultSettings() { | 92 PrintingContext::Result PrintingContextMac::UseDefaultSettings() { |
| 93 DCHECK(!in_print_job_); | 93 DCHECK(!in_print_job_); |
| 94 | 94 |
| 95 print_info_.reset([[NSPrintInfo sharedPrintInfo] copy]); | 95 print_info_.reset([[NSPrintInfo sharedPrintInfo] copy]); |
| 96 InitPrintSettingsFromPrintInfo(GetPageRangesFromPrintInfo()); | 96 InitPrintSettingsFromPrintInfo(GetPageRangesFromPrintInfo()); |
| 97 | 97 |
| 98 return OK; | 98 return OK; |
| 99 } | 99 } |
| 100 | 100 |
| 101 PrintingContext::Result PrintingContextMac::UpdatePrintSettings( | 101 PrintingContext::Result PrintingContextMac::UpdatePrinterSettings( |
| 102 const DictionaryValue& job_settings, const PageRanges& ranges) { | 102 const DictionaryValue& job_settings, const PageRanges& ranges) { |
| 103 DCHECK(!in_print_job_); | 103 DCHECK(!in_print_job_); |
| 104 | 104 |
| 105 // NOTE: Reset |print_info_| with a copy of |sharedPrintInfo| so as to start | 105 // NOTE: Reset |print_info_| with a copy of |sharedPrintInfo| so as to start |
| 106 // with a clean slate. | 106 // with a clean slate. |
| 107 print_info_.reset([[NSPrintInfo sharedPrintInfo] copy]); | 107 print_info_.reset([[NSPrintInfo sharedPrintInfo] copy]); |
| 108 | 108 |
| 109 bool collate; | 109 bool collate; |
| 110 bool color; | 110 bool color; |
| 111 bool landscape; | 111 bool landscape; |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 void PrintingContextMac::ReleaseContext() { | 370 void PrintingContextMac::ReleaseContext() { |
| 371 print_info_.reset(); | 371 print_info_.reset(); |
| 372 context_ = NULL; | 372 context_ = NULL; |
| 373 } | 373 } |
| 374 | 374 |
| 375 gfx::NativeDrawingContext PrintingContextMac::context() const { | 375 gfx::NativeDrawingContext PrintingContextMac::context() const { |
| 376 return context_; | 376 return context_; |
| 377 } | 377 } |
| 378 | 378 |
| 379 } // namespace printing | 379 } // namespace printing |
| OLD | NEW |