1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "components/printing/test/print_test_content_renderer_client.h"
7 #include "components/printing/renderer/print_web_view_helper.h"
8 #include "third_party/WebKit/public/web/WebElement.h"
13 class PrintWebViewHelperDelegate
: public PrintWebViewHelper::Delegate
{
15 ~PrintWebViewHelperDelegate() override
{}
16 bool CancelPrerender(content::RenderView
* render_view
,
17 int routing_id
) override
{
20 blink::WebElement
GetPdfElement(blink::WebLocalFrame
* frame
) override
{
21 return blink::WebElement();
23 bool IsPrintPreviewEnabled() override
{
24 #if defined(ENABLE_PRINT_PREVIEW)
30 bool OverridePrint(blink::WebLocalFrame
* frame
) override
{ return false; }
34 PrintTestContentRendererClient::PrintTestContentRendererClient() {
37 PrintTestContentRendererClient::~PrintTestContentRendererClient() {
40 void PrintTestContentRendererClient::RenderViewCreated(
41 content::RenderView
* render_view
) {
42 new printing::PrintWebViewHelper(
43 render_view
, scoped_ptr
<printing::PrintWebViewHelper::Delegate
>(
44 new PrintWebViewHelperDelegate()));
47 } // namespace printing