blob: cb9bbd0c1ae74c0004478f9df1d99bf8bcf7a9df [file] [log] [blame]
[email protected]5cc4c422011-02-19 00:09:221// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]b75dca82009-10-13 18:46:212// 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]b75dca82009-10-13 18:46:217#include "base/logging.h"
[email protected]b75dca82009-10-13 18:46:218#include "printing/page_number.h"
9#include "printing/printed_page.h"
[email protected]5cc4c422011-02-19 00:09:2210#include "printing/printing_context_cairo.h"
[email protected]b75dca82009-10-13 18:46:2111
12namespace printing {
13
14void PrintedDocument::RenderPrintedPage(
[email protected]5cc4c422011-02-19 00:09:2215 const PrintedPage& page, PrintingContext* context) const {
[email protected]b75dca82009-10-13 18:46:2116#ifndef NDEBUG
17 {
18 // Make sure the page is from our list.
[email protected]20305ec2011-01-21 04:55:5219 base::AutoLock lock(lock_);
[email protected]b75dca82009-10-13 18:46:2120 DCHECK(&page == mutable_.pages_.find(page.page_number() - 1)->second.get());
21 }
22#endif
23
[email protected]3b52c982010-09-27 20:40:3624 DCHECK(context);
25
[email protected]5cc4c422011-02-19 00:09:2226#if !defined(OS_CHROMEOS)
[email protected]da4eefd2011-03-03 23:40:2727 {
28 base::AutoLock lock(lock_);
29 if (page.page_number() - 1 == mutable_.first_page) {
30 reinterpret_cast<PrintingContextCairo*>(context)->PrintDocument(
31 page.native_metafile());
32 }
[email protected]5cc4c422011-02-19 00:09:2233 }
34#endif // !defined(OS_CHROMEOS)
[email protected]b75dca82009-10-13 18:46:2135}
36
[email protected]e0598782010-10-07 22:01:5237void PrintedDocument::DrawHeaderFooter(gfx::NativeDrawingContext context,
38 std::wstring text,
39 gfx::Rect bounds) const {
40 NOTIMPLEMENTED();
41}
42
[email protected]b75dca82009-10-13 18:46:2143} // namespace printing