OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_linux.h" | 5 #include "printing/printing_context_linux.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/ptr_util.h" |
8 #include "base/values.h" | 9 #include "base/values.h" |
9 #include "printing/metafile.h" | 10 #include "printing/metafile.h" |
10 #include "printing/print_dialog_gtk_interface.h" | 11 #include "printing/print_dialog_gtk_interface.h" |
11 #include "printing/print_job_constants.h" | 12 #include "printing/print_job_constants.h" |
12 #include "printing/units.h" | 13 #include "printing/units.h" |
13 | 14 |
14 namespace { | 15 namespace { |
15 | 16 |
16 // Function pointer for creating print dialogs. |callback| is only used when | 17 // Function pointer for creating print dialogs. |callback| is only used when |
17 // |show_dialog| is true. | 18 // |show_dialog| is true. |
18 printing::PrintDialogGtkInterface* (*create_dialog_func_)( | 19 printing::PrintDialogGtkInterface* (*create_dialog_func_)( |
19 printing::PrintingContextLinux* context) = NULL; | 20 printing::PrintingContextLinux* context) = NULL; |
20 | 21 |
21 // Function pointer for determining paper size. | 22 // Function pointer for determining paper size. |
22 gfx::Size (*get_pdf_paper_size_)( | 23 gfx::Size (*get_pdf_paper_size_)( |
23 printing::PrintingContextLinux* context) = NULL; | 24 printing::PrintingContextLinux* context) = NULL; |
24 | 25 |
25 } // namespace | 26 } // namespace |
26 | 27 |
27 namespace printing { | 28 namespace printing { |
28 | 29 |
29 // static | 30 // static |
30 scoped_ptr<PrintingContext> PrintingContext::Create(Delegate* delegate) { | 31 std::unique_ptr<PrintingContext> PrintingContext::Create(Delegate* delegate) { |
31 return make_scoped_ptr<PrintingContext>(new PrintingContextLinux(delegate)); | 32 return base::WrapUnique(new PrintingContextLinux(delegate)); |
32 } | 33 } |
33 | 34 |
34 PrintingContextLinux::PrintingContextLinux(Delegate* delegate) | 35 PrintingContextLinux::PrintingContextLinux(Delegate* delegate) |
35 : PrintingContext(delegate), print_dialog_(NULL) { | 36 : PrintingContext(delegate), print_dialog_(NULL) { |
36 } | 37 } |
37 | 38 |
38 PrintingContextLinux::~PrintingContextLinux() { | 39 PrintingContextLinux::~PrintingContextLinux() { |
39 ReleaseContext(); | 40 ReleaseContext(); |
40 | 41 |
41 if (print_dialog_) | 42 if (print_dialog_) |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 void PrintingContextLinux::ReleaseContext() { | 184 void PrintingContextLinux::ReleaseContext() { |
184 // Intentional No-op. | 185 // Intentional No-op. |
185 } | 186 } |
186 | 187 |
187 gfx::NativeDrawingContext PrintingContextLinux::context() const { | 188 gfx::NativeDrawingContext PrintingContextLinux::context() const { |
188 // Intentional No-op. | 189 // Intentional No-op. |
189 return NULL; | 190 return NULL; |
190 } | 191 } |
191 | 192 |
192 } // namespace printing | 193 } // namespace printing |
OLD | NEW |