| Index: printing/printed_document_chromeos.cc
|
| diff --git a/printing/printed_document_linux.cc b/printing/printed_document_chromeos.cc
|
| similarity index 51%
|
| copy from printing/printed_document_linux.cc
|
| copy to printing/printed_document_chromeos.cc
|
| index a104171ad56c144060be35c94c83fa36f937c1b5..5aedb981a58a63df1fdf41ab977cf847ff3fb20e 100644
|
| --- a/printing/printed_document_linux.cc
|
| +++ b/printing/printed_document_chromeos.cc
|
| @@ -1,4 +1,4 @@
|
| -// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| @@ -7,14 +7,13 @@
|
| #include "base/logging.h"
|
| #include "printing/page_number.h"
|
| #include "printing/printed_page.h"
|
| -#include "printing/printing_context_linux.h"
|
| +#include "printing/printing_context_chromeos.h"
|
|
|
| namespace printing {
|
|
|
| -#if !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
|
| -void PrintedDocument::RenderPrintedPage(
|
| - const PrintedPage& page, PrintingContext* context) const {
|
| -#ifndef NDEBUG
|
| +void PrintedDocument::RenderPrintedPage(const PrintedPage& page,
|
| + PrintingContext* context) const {
|
| +#ifdef NDEBUG
|
| {
|
| // Make sure the page is from our list.
|
| base::AutoLock lock(lock_);
|
| @@ -27,11 +26,16 @@ void PrintedDocument::RenderPrintedPage(
|
| {
|
| base::AutoLock lock(lock_);
|
| if (page.page_number() - 1 == mutable_.first_page) {
|
| - static_cast<PrintingContextLinux*>(context)
|
| - ->PrintDocument(*page.metafile());
|
| + std::vector<char> buffer;
|
| +
|
| + if (page.metafile()->GetDataAsVector(&buffer)) {
|
| + static_cast<PrintingContextChromeos*>(context)->StreamData(
|
| + buffer.data(), buffer.size());
|
| + } else {
|
| + LOG(WARNING) << "Failed to read data from metafile";
|
| + }
|
| }
|
| }
|
| }
|
| -#endif // !OS_CHROMEOS && !OS_ANDROID
|
|
|
| } // namespace printing
|
|
|