Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Unified Diff: chrome/browser/printing/print_composite_client.h

Issue 2653963002: [Experimental] Supporting OOPIF printing
Patch Set: Rename service, fix for webview, and connect to DiscardableMemoryManager Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_
« no previous file with comments | « chrome/browser/chrome_content_browser_manifest_overlay.json ('k') | chrome/browser/printing/print_composite_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698