OLD | NEW |
1 // Copyright (c) 2009 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/printed_document.h" | 5 #include "printing/printed_document.h" |
6 | 6 |
7 #include "base/file_util.h" | |
8 #include "base/logging.h" | 7 #include "base/logging.h" |
9 #include "base/message_loop.h" | |
10 #include "printing/page_number.h" | 8 #include "printing/page_number.h" |
11 #include "printing/printed_page.h" | 9 #include "printing/printed_page.h" |
| 10 #include "printing/printing_context_cairo.h" |
12 | 11 |
13 namespace printing { | 12 namespace printing { |
14 | 13 |
15 void PrintedDocument::RenderPrintedPage( | 14 void PrintedDocument::RenderPrintedPage( |
16 const PrintedPage& page, gfx::NativeDrawingContext context) const { | 15 const PrintedPage& page, PrintingContext* context) const { |
17 #ifndef NDEBUG | 16 #ifndef NDEBUG |
18 { | 17 { |
19 // Make sure the page is from our list. | 18 // Make sure the page is from our list. |
20 base::AutoLock lock(lock_); | 19 base::AutoLock lock(lock_); |
21 DCHECK(&page == mutable_.pages_.find(page.page_number() - 1)->second.get()); | 20 DCHECK(&page == mutable_.pages_.find(page.page_number() - 1)->second.get()); |
22 } | 21 } |
23 #endif | 22 #endif |
24 | 23 |
25 DCHECK(context); | 24 DCHECK(context); |
26 | 25 |
27 NOTIMPLEMENTED(); | 26 #if !defined(OS_CHROMEOS) |
| 27 if (page.page_number() == 1) { |
| 28 reinterpret_cast<PrintingContextCairo*>(context)->PrintDocument( |
| 29 page.native_metafile()); |
| 30 } |
| 31 #endif // !defined(OS_CHROMEOS) |
28 } | 32 } |
29 | 33 |
30 void PrintedDocument::DrawHeaderFooter(gfx::NativeDrawingContext context, | 34 void PrintedDocument::DrawHeaderFooter(gfx::NativeDrawingContext context, |
31 std::wstring text, | 35 std::wstring text, |
32 gfx::Rect bounds) const { | 36 gfx::Rect bounds) const { |
33 NOTIMPLEMENTED(); | 37 NOTIMPLEMENTED(); |
34 } | 38 } |
35 | 39 |
36 } // namespace printing | 40 } // namespace printing |
OLD | NEW |