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

Side by Side Diff: printing/printing_context_mac.mm

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_linux.cc ('k') | printing/printing_context_no_system_dialog.cc » ('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 (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 <AppKit/AppKit.h> 7 #import <AppKit/AppKit.h>
8 8
9 #import <iomanip> 9 #import <iomanip>
10 #import <numeric> 10 #import <numeric>
11 11
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/mac/scoped_cftyperef.h" 13 #include "base/mac/scoped_cftyperef.h"
14 #include "base/mac/scoped_nsautorelease_pool.h" 14 #include "base/mac/scoped_nsautorelease_pool.h"
15 #include "base/memory/ptr_util.h"
15 #include "base/strings/sys_string_conversions.h" 16 #include "base/strings/sys_string_conversions.h"
16 #include "base/strings/utf_string_conversions.h" 17 #include "base/strings/utf_string_conversions.h"
17 #include "base/values.h" 18 #include "base/values.h"
18 #include "printing/print_settings_initializer_mac.h" 19 #include "printing/print_settings_initializer_mac.h"
19 #include "printing/units.h" 20 #include "printing/units.h"
20 21
21 namespace printing { 22 namespace printing {
22 23
23 namespace { 24 namespace {
24 25
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 best_matching_paper = paper; 60 best_matching_paper = paper;
60 best_match = difference; 61 best_match = difference;
61 } 62 }
62 } 63 }
63 return best_matching_paper; 64 return best_matching_paper;
64 } 65 }
65 66
66 } // namespace 67 } // namespace
67 68
68 // static 69 // static
69 scoped_ptr<PrintingContext> PrintingContext::Create(Delegate* delegate) { 70 std::unique_ptr<PrintingContext> PrintingContext::Create(Delegate* delegate) {
70 return make_scoped_ptr<PrintingContext>(new PrintingContextMac(delegate)); 71 return base::WrapUnique(new PrintingContextMac(delegate));
71 } 72 }
72 73
73 PrintingContextMac::PrintingContextMac(Delegate* delegate) 74 PrintingContextMac::PrintingContextMac(Delegate* delegate)
74 : PrintingContext(delegate), 75 : PrintingContext(delegate),
75 print_info_([[NSPrintInfo sharedPrintInfo] copy]), 76 print_info_([[NSPrintInfo sharedPrintInfo] copy]),
76 context_(NULL) { 77 context_(NULL) {
77 } 78 }
78 79
79 PrintingContextMac::~PrintingContextMac() { 80 PrintingContextMac::~PrintingContextMac() {
80 ReleaseContext(); 81 ReleaseContext();
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 void PrintingContextMac::ReleaseContext() { 514 void PrintingContextMac::ReleaseContext() {
514 print_info_.reset(); 515 print_info_.reset();
515 context_ = NULL; 516 context_ = NULL;
516 } 517 }
517 518
518 gfx::NativeDrawingContext PrintingContextMac::context() const { 519 gfx::NativeDrawingContext PrintingContextMac::context() const {
519 return context_; 520 return context_;
520 } 521 }
521 522
522 } // namespace printing 523 } // namespace printing
OLDNEW
« no previous file with comments | « printing/printing_context_linux.cc ('k') | printing/printing_context_no_system_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698