| Index: chrome/browser/printing/print_composite_client.h
|
| diff --git a/chrome/browser/printing/print_composite_client.h b/chrome/browser/printing/print_composite_client.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d379378dbe681cd48cb0c27dedea4d3736eac0dd
|
| --- /dev/null
|
| +++ b/chrome/browser/printing/print_composite_client.h
|
| @@ -0,0 +1,59 @@
|
| +// Copyright 2017 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.
|
| +
|
| +#include "base/memory/shared_memory_handle.h"
|
| +#include "base/sequenced_task_runner.h"
|
| +#include "content/public/browser/notification_observer.h"
|
| +#include "content/public/browser/notification_registrar.h"
|
| +#include "content/public/browser/web_contents_observer.h"
|
| +#include "content/public/browser/web_contents_user_data.h"
|
| +#include "services/pdf_compositor/public/cpp/pdf_compositor_client.h"
|
| +
|
| +#ifndef CHROME_BROWSER_PRINTING_PRINT_COMPOSITE_CLIENT_H_
|
| +#define CHROME_BROWSER_PRINTING_PRINT_COMPOSITE_CLIENT_H_
|
| +
|
| +namespace printing {
|
| +
|
| +class PrintCompositeClient
|
| + : public pdf_compositor::PdfCompositorClient,
|
| + public content::NotificationObserver,
|
| + public content::WebContentsObserver,
|
| + public content::WebContentsUserData<PrintCompositeClient> {
|
| + public:
|
| + explicit PrintCompositeClient(content::WebContents* web_contents);
|
| + ~PrintCompositeClient() override;
|
| +
|
| + void DoComposite(
|
| + int page_num,
|
| + base::SharedMemoryHandle handle,
|
| + uint32_t data_size,
|
| + const pdf_compositor::mojom::PdfCompositor::CompositePdfCallback&
|
| + callback,
|
| + scoped_refptr<base::SequencedTaskRunner> callback_task_runner);
|
| +
|
| + private:
|
| + // content::NotificationObserver implementation.
|
| + void Observe(int type,
|
| + const content::NotificationSource& source,
|
| + const content::NotificationDetails& details) override;
|
| +
|
| + void OnIsReadyToComposite(
|
| + int page_num,
|
| + base::SharedMemoryHandle handle,
|
| + uint32_t data_size,
|
| + const pdf_compositor::mojom::PdfCompositor::CompositePdfCallback&
|
| + callback,
|
| + scoped_refptr<base::SequencedTaskRunner> callback_task_runner,
|
| + bool status);
|
| +
|
| + content::NotificationRegistrar registrar_;
|
| +
|
| + base::WeakPtrFactory<PrintCompositeClient> weak_factory_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(PrintCompositeClient);
|
| +};
|
| +
|
| +} // namespace printing
|
| +
|
| +#endif // CHROME_BROWSER_PRINTING_PRINT_COMPOSITE_CLIENT_H_
|
|
|