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 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/string16.h" | 11 #include "base/string16.h" |
12 #include "base/synchronization/lock.h" | 12 #include "base/synchronization/lock.h" |
13 #include "printing/print_settings.h" | 13 #include "printing/print_settings.h" |
14 #include "ui/gfx/native_widget_types.h" | 14 #include "ui/gfx/native_widget_types.h" |
15 | 15 |
16 class MessageLoop; | |
17 | |
18 namespace base { | 16 namespace base { |
19 class FilePath; | 17 class FilePath; |
| 18 class MessageLoop; |
20 } | 19 } |
21 | 20 |
22 namespace printing { | 21 namespace printing { |
23 | 22 |
24 class Metafile; | 23 class Metafile; |
25 class PrintedPage; | 24 class PrintedPage; |
26 class PrintedPagesSource; | 25 class PrintedPagesSource; |
27 class PrintingContext; | 26 class PrintingContext; |
28 | 27 |
29 // A collection of rendered pages. The settings are immutable. If the print | 28 // A collection of rendered pages. The settings are immutable. If the print |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // construction. | 139 // construction. |
141 struct Immutable { | 140 struct Immutable { |
142 Immutable(const PrintSettings& settings, PrintedPagesSource* source, | 141 Immutable(const PrintSettings& settings, PrintedPagesSource* source, |
143 int cookie); | 142 int cookie); |
144 ~Immutable(); | 143 ~Immutable(); |
145 | 144 |
146 // Print settings used to generate this document. Immutable. | 145 // Print settings used to generate this document. Immutable. |
147 PrintSettings settings_; | 146 PrintSettings settings_; |
148 | 147 |
149 // Native thread for the render source. | 148 // Native thread for the render source. |
150 MessageLoop* source_message_loop_; | 149 base::MessageLoop* source_message_loop_; |
151 | 150 |
152 // Document name. Immutable. | 151 // Document name. Immutable. |
153 string16 name_; | 152 string16 name_; |
154 | 153 |
155 // Cookie to uniquely identify this document. It is used to make sure that a | 154 // Cookie to uniquely identify this document. It is used to make sure that a |
156 // PrintedPage is correctly belonging to the PrintedDocument. Since | 155 // PrintedPage is correctly belonging to the PrintedDocument. Since |
157 // PrintedPage generation is completely asynchronous, it could be easy to | 156 // PrintedPage generation is completely asynchronous, it could be easy to |
158 // mess up and send the page to the wrong document. It can be viewed as a | 157 // mess up and send the page to the wrong document. It can be viewed as a |
159 // simpler hash of PrintSettings since a new document is made each time the | 158 // simpler hash of PrintSettings since a new document is made each time the |
160 // print settings change. | 159 // print settings change. |
(...skipping 11 matching lines...) Expand all Loading... |
172 | 171 |
173 // All the immutable members. | 172 // All the immutable members. |
174 const Immutable immutable_; | 173 const Immutable immutable_; |
175 | 174 |
176 DISALLOW_COPY_AND_ASSIGN(PrintedDocument); | 175 DISALLOW_COPY_AND_ASSIGN(PrintedDocument); |
177 }; | 176 }; |
178 | 177 |
179 } // namespace printing | 178 } // namespace printing |
180 | 179 |
181 #endif // PRINTING_PRINTED_DOCUMENT_H_ | 180 #endif // PRINTING_PRINTED_DOCUMENT_H_ |
OLD | NEW |