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

Unified Diff: chrome/renderer/printing/chrome_print_web_view_helper_delegate.cc

Issue 791133006: Delegates for the printing component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Using initialisation parameters instead of delegate methods Created 5 years, 11 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/renderer/printing/chrome_print_web_view_helper_delegate.cc
diff --git a/chrome/renderer/printing/chrome_print_web_view_helper_delegate.cc b/chrome/renderer/printing/chrome_print_web_view_helper_delegate.cc
new file mode 100644
index 0000000000000000000000000000000000000000..190a02b71966c08a75adbd9830687cd24b03d8a0
--- /dev/null
+++ b/chrome/renderer/printing/chrome_print_web_view_helper_delegate.cc
@@ -0,0 +1,35 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
Lei Zhang 2015/01/06 04:11:32 It's 2015. :)
dgn 2015/01/06 16:35:31 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/renderer/printing/chrome_print_web_view_helper_delegate.h"
+
+#include "base/command_line.h"
+#include "chrome/common/chrome_switches.h"
+#include "chrome/common/render_messages.h"
+#include "chrome/renderer/prerender/prerender_helper.h"
+#include "content/public/renderer/render_view.h"
+#include "ipc/ipc_message.h"
+
+
+ChromePrintWebViewHelperDelegate::~ChromePrintWebViewHelperDelegate(){
+}
+
+bool ChromePrintWebViewHelperDelegate::CancelPrerender(
+ content::RenderView* render_view, int routing_id) {
+ if (!render_view || !prerender::PrerenderHelper::IsPrerendering(
+ render_view->GetMainRenderFrame()))
+ return false;
+
+ return render_view->Send(
+ new ChromeViewHostMsg_CancelPrerenderForPrinting(routing_id));
+}
+
+bool ChromePrintWebViewHelperDelegate::OutOfProcessPdfEnabled() const {
+ return switches::OutOfProcessPdfEnabled();
+}
+
+bool ChromePrintWebViewHelperDelegate::PrintPreviewDisabled() const {
+ return CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisablePrintPreview);
+}

Powered by Google App Engine
This is Rietveld 408576698