1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "printing/printed_document.h"
7 #include "base/logging.h"
8 #include "build/build_config.h"
9 #include "printing/printing_context_linux.h"
11 #if defined(OS_ANDROID) || defined(OS_CHROMEOS)
12 #error "This file is not used on Android / ChromeOS"
17 bool PrintedDocument::RenderPrintedDocument(PrintingContext* context) {
20 if (context->NewPage() != PrintingContext::OK)
23 base::AutoLock lock(lock_);
24 const MetafilePlayer* metafile = GetMetafile();
26 static_cast<PrintingContextLinux*>(context)->PrintDocument(*metafile);
28 return context->PageDone() == PrintingContext::OK;
31 } // namespace printing