Upload upstream chromium 73.0.3683.0
[platform/framework/web/chromium-efl.git] / printing / printed_document_android.cc
1 // Copyright 2019 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 "printing/printing_context_android.h"
9
10 namespace printing {
11
12 bool PrintedDocument::RenderPrintedDocument(PrintingContext* context) {
13   DCHECK(context);
14
15   if (context->NewPage() != PrintingContext::OK)
16     return false;
17   {
18     base::AutoLock lock(lock_);
19     const MetafilePlayer* metafile = GetMetafile();
20     DCHECK(metafile);
21     static_cast<PrintingContextAndroid*>(context)->PrintDocument(*metafile);
22   }
23   return context->PageDone() == PrintingContext::OK;
24 }
25
26 }  // namespace printing