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

Unified Diff: headless/lib/renderer/headless_print_web_view_helper_delegate.h

Issue 2780433002: add print to pdf for headless (Closed)
Patch Set: improve comments as suggested Created 3 years, 8 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: headless/lib/renderer/headless_print_web_view_helper_delegate.h
diff --git a/headless/lib/renderer/headless_print_web_view_helper_delegate.h b/headless/lib/renderer/headless_print_web_view_helper_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..691974c029b03f39f4a9b802ae2a8297158b61b6
--- /dev/null
+++ b/headless/lib/renderer/headless_print_web_view_helper_delegate.h
@@ -0,0 +1,32 @@
+// 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.
+
+#ifndef HEADLESS_LIB_RENDERER_HEADLESS_PRINT_WEB_VIEW_HELPER_DELEGATE_H_
+#define HEADLESS_LIB_RENDERER_HEADLESS_PRINT_WEB_VIEW_HELPER_DELEGATE_H_
+
+#include "components/printing/renderer/print_web_view_helper.h"
+
+namespace headless {
+
+class HeadlessPrintWebViewHelperDelegate
+ : public printing::PrintWebViewHelper::Delegate {
+ public:
+ HeadlessPrintWebViewHelperDelegate();
+ ~HeadlessPrintWebViewHelperDelegate() override;
+
+ // PrintWebViewHelper Delegate implementation.
+ bool CancelPrerender(content::RenderFrame* render_frame) override;
+ bool IsPrintPreviewEnabled() override;
+ bool OverridePrint(blink::WebLocalFrame* frame) override;
+ bool IsAskPrintSettingsEnabled() override;
+ blink::WebElement GetPdfElement(blink::WebLocalFrame* frame) override;
+
+#if defined(OS_MACOSX)
+ bool UseSingleMetafile() override;
+#endif
+};
+
+} // namespace headless
+
+#endif // HEADLESS_LIB_RENDERER_HEADLESS_PRINT_WEB_VIEW_HELPER_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698