[email protected] | d53002f4 | 2014-01-14 16:08:56 | [diff] [blame] | 1 | // Copyright 2014 The Chromium Authors. All rights reserved. |
[email protected] | b75dca8 | 2009-10-13 18:46:21 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #include "printing/printed_document.h" | ||||
6 | |||||
[email protected] | b75dca8 | 2009-10-13 18:46:21 | [diff] [blame] | 7 | #include "base/logging.h" |
[email protected] | b75dca8 | 2009-10-13 18:46:21 | [diff] [blame] | 8 | #include "printing/page_number.h" |
9 | #include "printing/printed_page.h" | ||||
[email protected] | d53002f4 | 2014-01-14 16:08:56 | [diff] [blame] | 10 | #include "printing/printing_context_linux.h" |
[email protected] | b75dca8 | 2009-10-13 18:46:21 | [diff] [blame] | 11 | |
12 | namespace printing { | ||||
13 | |||||
skau | b793195 | 2016-07-27 18:04:51 | [diff] [blame] | 14 | #if !defined(OS_ANDROID) |
[email protected] | b75dca8 | 2009-10-13 18:46:21 | [diff] [blame] | 15 | void PrintedDocument::RenderPrintedPage( |
[email protected] | 5cc4c42 | 2011-02-19 00:09:22 | [diff] [blame] | 16 | const PrintedPage& page, PrintingContext* context) const { |
[email protected] | b75dca8 | 2009-10-13 18:46:21 | [diff] [blame] | 17 | #ifndef NDEBUG |
18 | { | ||||
19 | // Make sure the page is from our list. | ||||
[email protected] | 20305ec | 2011-01-21 04:55:52 | [diff] [blame] | 20 | base::AutoLock lock(lock_); |
[email protected] | b75dca8 | 2009-10-13 18:46:21 | [diff] [blame] | 21 | DCHECK(&page == mutable_.pages_.find(page.page_number() - 1)->second.get()); |
22 | } | ||||
23 | #endif | ||||
24 | |||||
[email protected] | 3b52c98 | 2010-09-27 20:40:36 | [diff] [blame] | 25 | DCHECK(context); |
26 | |||||
[email protected] | da4eefd | 2011-03-03 23:40:27 | [diff] [blame] | 27 | { |
28 | base::AutoLock lock(lock_); | ||||
29 | if (page.page_number() - 1 == mutable_.first_page) { | ||||
vitalybuka | 5d129058 | 2014-09-12 09:19:59 | [diff] [blame] | 30 | static_cast<PrintingContextLinux*>(context) |
31 | ->PrintDocument(*page.metafile()); | ||||
[email protected] | da4eefd | 2011-03-03 23:40:27 | [diff] [blame] | 32 | } |
[email protected] | 5cc4c42 | 2011-02-19 00:09:22 | [diff] [blame] | 33 | } |
[email protected] | b75dca8 | 2009-10-13 18:46:21 | [diff] [blame] | 34 | } |
skau | b793195 | 2016-07-27 18:04:51 | [diff] [blame] | 35 | #endif // !OS_ANDROID |
[email protected] | b75dca8 | 2009-10-13 18:46:21 | [diff] [blame] | 36 | |
[email protected] | b75dca8 | 2009-10-13 18:46:21 | [diff] [blame] | 37 | } // namespace printing |