blob: 87bc30e7d0faad38c9c36665f794e053348cc3c9 [file] [log] [blame]
[email protected]d53002f42014-01-14 16:08:561// Copyright 2014 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"
Lei Zhang933d34b2017-11-13 20:59:298#include "build/build_config.h"
[email protected]d53002f42014-01-14 16:08:569#include "printing/printing_context_linux.h"
[email protected]b75dca82009-10-13 18:46:2110
Lei Zhang933d34b2017-11-13 20:59:2911#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
12#error "This file is not used on Android / ChromeOS"
13#endif
14
[email protected]b75dca82009-10-13 18:46:2115namespace printing {
16
rbpotter80cbe042017-12-08 07:00:5217bool PrintedDocument::RenderPrintedDocument(PrintingContext* context) {
[email protected]3b52c982010-09-27 20:40:3618 DCHECK(context);
19
rbpotter80cbe042017-12-08 07:00:5220 if (context->NewPage() != PrintingContext::OK)
21 return false;
[email protected]da4eefd2011-03-03 23:40:2722 {
23 base::AutoLock lock(lock_);
rbpotter80cbe042017-12-08 07:00:5224 const MetafilePlayer* metafile = GetMetafile();
25 DCHECK(metafile);
26 static_cast<PrintingContextLinux*>(context)->PrintDocument(*metafile);
[email protected]5cc4c422011-02-19 00:09:2227 }
rbpotter80cbe042017-12-08 07:00:5228 return context->PageDone() == PrintingContext::OK;
[email protected]b75dca82009-10-13 18:46:2129}
30
[email protected]b75dca82009-10-13 18:46:2131} // namespace printing