Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Side by Side Diff: printing/printing_context_linux.cc

Issue 1863223002: Convert //printing to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « printing/printing_context_android.cc ('k') | printing/printing_context_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « printing/printing_context_android.cc ('k') | printing/printing_context_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698