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

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

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.cc
diff --git a/headless/lib/renderer/headless_print_web_view_helper_delegate.cc b/headless/lib/renderer/headless_print_web_view_helper_delegate.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8afe740fe09479b826934e8b5cfe72667b7299eb
--- /dev/null
+++ b/headless/lib/renderer/headless_print_web_view_helper_delegate.cc
@@ -0,0 +1,44 @@
+// 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 "headless/lib/renderer/headless_print_web_view_helper_delegate.h"
+
+#include "third_party/WebKit/public/web/WebElement.h"
+
+namespace headless {
+
+HeadlessPrintWebViewHelperDelegate::HeadlessPrintWebViewHelperDelegate() {}
+
+HeadlessPrintWebViewHelperDelegate::~HeadlessPrintWebViewHelperDelegate() {}
+
+bool HeadlessPrintWebViewHelperDelegate::CancelPrerender(
+ content::RenderFrame* render_frame) {
+ return false;
+}
+
+blink::WebElement HeadlessPrintWebViewHelperDelegate::GetPdfElement(
+ blink::WebLocalFrame* frame) {
+ return blink::WebElement();
+}
+
+bool HeadlessPrintWebViewHelperDelegate::IsPrintPreviewEnabled() {
+ return false;
+}
+
+bool HeadlessPrintWebViewHelperDelegate::OverridePrint(
+ blink::WebLocalFrame* frame) {
+ return false;
+}
+
+bool HeadlessPrintWebViewHelperDelegate::IsAskPrintSettingsEnabled() {
+ return false;
+}
+
+#if defined(OS_MACOSX)
+bool HeadlessPrintWebViewHelperDelegate::UseSingleMetafile() {
+ return true;
+}
+#endif
+
+} // namespace headless

Powered by Google App Engine
This is Rietveld 408576698