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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 NULL, NULL) == noErr; | 179 NULL, NULL) == noErr; |
180 } | 180 } |
181 | 181 |
182 void PrintingContextMac::InitPrintSettingsFromPrintInfo() { | 182 void PrintingContextMac::InitPrintSettingsFromPrintInfo() { |
183 PMPrintSession print_session = | 183 PMPrintSession print_session = |
184 static_cast<PMPrintSession>([print_info_.get() PMPrintSession]); | 184 static_cast<PMPrintSession>([print_info_.get() PMPrintSession]); |
185 PMPageFormat page_format = | 185 PMPageFormat page_format = |
186 static_cast<PMPageFormat>([print_info_.get() PMPageFormat]); | 186 static_cast<PMPageFormat>([print_info_.get() PMPageFormat]); |
187 PMPrinter printer; | 187 PMPrinter printer; |
188 PMSessionGetCurrentPrinter(print_session, &printer); | 188 PMSessionGetCurrentPrinter(print_session, &printer); |
189 settings_.set_selection_only(false); | |
190 PrintSettingsInitializerMac::InitPrintSettings( | 189 PrintSettingsInitializerMac::InitPrintSettings( |
191 printer, page_format, &settings_); | 190 printer, page_format, &settings_); |
192 } | 191 } |
193 | 192 |
194 bool PrintingContextMac::SetPrinter(const std::string& device_name) { | 193 bool PrintingContextMac::SetPrinter(const std::string& device_name) { |
195 DCHECK(print_info_.get()); | 194 DCHECK(print_info_.get()); |
196 PMPrintSession print_session = | 195 PMPrintSession print_session = |
197 static_cast<PMPrintSession>([print_info_.get() PMPrintSession]); | 196 static_cast<PMPrintSession>([print_info_.get() PMPrintSession]); |
198 | 197 |
199 PMPrinter current_printer; | 198 PMPrinter current_printer; |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 void PrintingContextMac::ReleaseContext() { | 499 void PrintingContextMac::ReleaseContext() { |
501 print_info_.reset(); | 500 print_info_.reset(); |
502 context_ = NULL; | 501 context_ = NULL; |
503 } | 502 } |
504 | 503 |
505 gfx::NativeDrawingContext PrintingContextMac::context() const { | 504 gfx::NativeDrawingContext PrintingContextMac::context() const { |
506 return context_; | 505 return context_; |
507 } | 506 } |
508 | 507 |
509 } // namespace printing | 508 } // namespace printing |
OLD | NEW |