blob: 4ee7df5fb0b81c609bc631e9502634018f2a5808 [file] [log] [blame]
// Copyright 2021 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 COMPONENTS_PDF_RENDERER_INTERNAL_PLUGIN_RENDERER_HELPERS_H_
#define COMPONENTS_PDF_RENDERER_INTERNAL_PLUGIN_RENDERER_HELPERS_H_
#include <memory>
namespace blink {
class WebPlugin;
struct WebPluginParams;
} // namespace blink
namespace content {
class RenderFrame;
struct WebPluginInfo;
} // namespace content
namespace pdf {
class PdfInternalPluginDelegate;
// Tries to create an instance of the internal PDF plugin, returning `nullptr`
// if the plugin cannot be created. This function handles both the Pepper and
// Pepper-free implementations, delegating to `content::RenderFrame` when
// creating a Pepper plugin instance.
//
// Note that `blink::WebPlugin` has a special life cycle, so it's returned as a
// raw pointer here.
blink::WebPlugin* CreateInternalPlugin(
const content::WebPluginInfo& info,
blink::WebPluginParams params,
content::RenderFrame* render_frame,
std::unique_ptr<PdfInternalPluginDelegate> delegate);
} // namespace pdf
#endif // COMPONENTS_PDF_RENDERER_INTERNAL_PLUGIN_RENDERER_HELPERS_H_