OLD | NEW |
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_PRINTED_DOCUMENT_H_ | 5 #ifndef PRINTING_PRINTED_DOCUMENT_H_ |
6 #define PRINTING_PRINTED_DOCUMENT_H_ | 6 #define PRINTING_PRINTED_DOCUMENT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
| 9 #include <memory> |
9 | 10 |
10 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
16 #include "printing/print_settings.h" | 16 #include "printing/print_settings.h" |
17 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
18 | 18 |
19 namespace base { | 19 namespace base { |
20 class RefCountedMemory; | 20 class RefCountedMemory; |
21 class TaskRunner; | 21 class TaskRunner; |
22 } | 22 } |
23 | 23 |
(...skipping 16 matching lines...) Expand all Loading... |
40 // The cookie shall be unique and has a specific relationship with its | 40 // The cookie shall be unique and has a specific relationship with its |
41 // originating source and settings. | 41 // originating source and settings. |
42 PrintedDocument(const PrintSettings& settings, | 42 PrintedDocument(const PrintSettings& settings, |
43 PrintedPagesSource* source, | 43 PrintedPagesSource* source, |
44 int cookie, | 44 int cookie, |
45 base::TaskRunner* blocking_runner); | 45 base::TaskRunner* blocking_runner); |
46 | 46 |
47 // Sets a page's data. 0-based. Takes metafile ownership. | 47 // Sets a page's data. 0-based. Takes metafile ownership. |
48 // Note: locks for a short amount of time. | 48 // Note: locks for a short amount of time. |
49 void SetPage(int page_number, | 49 void SetPage(int page_number, |
50 scoped_ptr<MetafilePlayer> metafile, | 50 std::unique_ptr<MetafilePlayer> metafile, |
51 #if defined(OS_WIN) | 51 #if defined(OS_WIN) |
52 float shrink, | 52 float shrink, |
53 #endif // OS_WIN | 53 #endif // OS_WIN |
54 const gfx::Size& paper_size, | 54 const gfx::Size& paper_size, |
55 const gfx::Rect& page_rect); | 55 const gfx::Rect& page_rect); |
56 | 56 |
57 // Retrieves a page. If the page is not available right now, it | 57 // Retrieves a page. If the page is not available right now, it |
58 // requests to have this page be rendered and returns NULL. | 58 // requests to have this page be rendered and returns NULL. |
59 // Note: locks for a short amount of time. | 59 // Note: locks for a short amount of time. |
60 scoped_refptr<PrintedPage> GetPage(int page_number); | 60 scoped_refptr<PrintedPage> GetPage(int page_number); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 185 |
186 // All the immutable members. | 186 // All the immutable members. |
187 const Immutable immutable_; | 187 const Immutable immutable_; |
188 | 188 |
189 DISALLOW_COPY_AND_ASSIGN(PrintedDocument); | 189 DISALLOW_COPY_AND_ASSIGN(PrintedDocument); |
190 }; | 190 }; |
191 | 191 |
192 } // namespace printing | 192 } // namespace printing |
193 | 193 |
194 #endif // PRINTING_PRINTED_DOCUMENT_H_ | 194 #endif // PRINTING_PRINTED_DOCUMENT_H_ |
OLD | NEW |