OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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" |
11 #include "base/mac/scoped_cftyperef.h" | 11 #include "base/mac/scoped_cftyperef.h" |
12 #include "base/sys_string_conversions.h" | 12 #include "base/sys_string_conversions.h" |
13 #include "printing/print_settings_initializer_mac.h" | 13 #include "printing/print_settings_initializer_mac.h" |
14 | 14 |
15 namespace printing { | 15 namespace printing { |
16 | 16 |
17 // static | 17 // static |
18 PrintingContext* PrintingContext::Create() { | 18 PrintingContext* PrintingContext::Create(const std::string& app_locale) { |
19 return static_cast<PrintingContext*>(new PrintingContextMac); | 19 return static_cast<PrintingContext*>(new PrintingContextMac(app_locale)); |
20 } | 20 } |
21 | 21 |
22 PrintingContextMac::PrintingContextMac() | 22 PrintingContextMac::PrintingContextMac(const std::string& app_locale) |
23 : PrintingContext(), | 23 : PrintingContext(app_locale), |
24 print_info_(NULL), | 24 print_info_(NULL), |
25 context_(NULL) { | 25 context_(NULL) { |
26 } | 26 } |
27 | 27 |
28 PrintingContextMac::~PrintingContextMac() { | 28 PrintingContextMac::~PrintingContextMac() { |
29 ReleaseContext(); | 29 ReleaseContext(); |
30 } | 30 } |
31 | 31 |
32 void PrintingContextMac::AskUserForSettings(gfx::NativeView parent_view, | 32 void PrintingContextMac::AskUserForSettings(gfx::NativeView parent_view, |
33 int max_pages, | 33 int max_pages, |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 print_info_ = nil; | 211 print_info_ = nil; |
212 context_ = NULL; | 212 context_ = NULL; |
213 } | 213 } |
214 } | 214 } |
215 | 215 |
216 gfx::NativeDrawingContext PrintingContextMac::context() const { | 216 gfx::NativeDrawingContext PrintingContextMac::context() const { |
217 return context_; | 217 return context_; |
218 } | 218 } |
219 | 219 |
220 } // namespace printing | 220 } // namespace printing |
OLD | NEW |