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

Side by Side Diff: printing/pdf_metafile_skia.h

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/emf_win_unittest.cc ('k') | printing/pdf_metafile_skia.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef PRINTING_PDF_METAFILE_SKIA_H_ 5 #ifndef PRINTING_PDF_METAFILE_SKIA_H_
6 #define PRINTING_PDF_METAFILE_SKIA_H_ 6 #define PRINTING_PDF_METAFILE_SKIA_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory>
11
10 #include "base/macros.h" 12 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "build/build_config.h" 13 #include "build/build_config.h"
13 #include "printing/metafile.h" 14 #include "printing/metafile.h"
14 #include "skia/ext/platform_canvas.h" 15 #include "skia/ext/platform_canvas.h"
15 16
16 #if defined(OS_WIN) 17 #if defined(OS_WIN)
17 #include <windows.h> 18 #include <windows.h>
18 #endif 19 #endif
19 20
20 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) 21 #if defined(OS_CHROMEOS) || defined(OS_ANDROID)
21 namespace base { 22 namespace base {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 #endif 64 #endif
64 65
65 bool SaveTo(base::File* file) const override; 66 bool SaveTo(base::File* file) const override;
66 67
67 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) 68 #if defined(OS_CHROMEOS) || defined(OS_ANDROID)
68 // TODO(vitalybuka): replace with SaveTo(). 69 // TODO(vitalybuka): replace with SaveTo().
69 bool SaveToFD(const base::FileDescriptor& fd) const; 70 bool SaveToFD(const base::FileDescriptor& fd) const;
70 #endif // if defined(OS_CHROMEOS) || defined(OS_ANDROID) 71 #endif // if defined(OS_CHROMEOS) || defined(OS_ANDROID)
71 72
72 // Return a new metafile containing just the current page in draft mode. 73 // Return a new metafile containing just the current page in draft mode.
73 scoped_ptr<PdfMetafileSkia> GetMetafileForCurrentPage(); 74 std::unique_ptr<PdfMetafileSkia> GetMetafileForCurrentPage();
74 75
75 // This method calls StartPage and then returns an appropriate 76 // This method calls StartPage and then returns an appropriate
76 // PlatformCanvas implementation bound to the context created by 77 // PlatformCanvas implementation bound to the context created by
77 // StartPage or NULL on error. The SkCanvas pointer that 78 // StartPage or NULL on error. The SkCanvas pointer that
78 // is returned is owned by this PdfMetafileSkia object and does not 79 // is returned is owned by this PdfMetafileSkia object and does not
79 // need to be ref()ed or unref()ed. The canvas will remain valid 80 // need to be ref()ed or unref()ed. The canvas will remain valid
80 // until FinishPage() or FinishDocument() is called. 81 // until FinishPage() or FinishDocument() is called.
81 SkCanvas* GetVectorCanvasForNewPage(const gfx::Size& page_size, 82 SkCanvas* GetVectorCanvasForNewPage(const gfx::Size& page_size,
82 const gfx::Rect& content_area, 83 const gfx::Rect& content_area,
83 const float& scale_factor); 84 const float& scale_factor);
84 85
85 private: 86 private:
86 scoped_ptr<PdfMetafileSkiaData> data_; 87 std::unique_ptr<PdfMetafileSkiaData> data_;
87 88
88 DISALLOW_COPY_AND_ASSIGN(PdfMetafileSkia); 89 DISALLOW_COPY_AND_ASSIGN(PdfMetafileSkia);
89 }; 90 };
90 91
91 } // namespace printing 92 } // namespace printing
92 93
93 #endif // PRINTING_PDF_METAFILE_SKIA_H_ 94 #endif // PRINTING_PDF_METAFILE_SKIA_H_
OLDNEW
« no previous file with comments | « printing/emf_win_unittest.cc ('k') | printing/pdf_metafile_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698