Upload upstream chromium 73.0.3683.0
[platform/framework/web/chromium-efl.git] / printing / printed_document_linux.cc
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.
4
5 #include "printing/printed_document.h"
6
7 #include "base/logging.h"
8 #include "build/build_config.h"
9 #include "printing/printing_context_linux.h"
10
11 #if defined(OS_ANDROID) || defined(OS_CHROMEOS)
12 #error "This file is not used on Android / ChromeOS"
13 #endif
14
15 namespace printing {
16
17 bool PrintedDocument::RenderPrintedDocument(PrintingContext* context) {
18   DCHECK(context);
19
20   if (context->NewPage() != PrintingContext::OK)
21     return false;
22   {
23     base::AutoLock lock(lock_);
24     const MetafilePlayer* metafile = GetMetafile();
25     DCHECK(metafile);
26     static_cast<PrintingContextLinux*>(context)->PrintDocument(*metafile);
27   }
28   return context->PageDone() == PrintingContext::OK;
29 }
30
31 }  // namespace printing