blob: 987f1f9edca92a0af9a636f297a1b7828db00ce5 [file] [log] [blame]
// 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 "components/plugins/renderer/plugin_placeholder.h"
// Placeholder that allows users to click to download a PDF for when
// plugins are disabled and the PDF fails to load.
// TODO(amberwon): Flesh out the class more to download an embedded PDF when the
// PDF plugin is disabled or unavailable.
class PDFPluginPlaceholder : public plugins::PluginPlaceholderBase,
public gin::Wrappable<PDFPluginPlaceholder> {
static gin::WrapperInfo kWrapperInfo;
// Returned placeholder is owned by the associated plugin, which can be
// retrieved with PluginPlaceholderBase::plugin().
static PDFPluginPlaceholder* CreatePDFPlaceholder(
content::RenderFrame* render_frame,
const blink::WebPluginParams& params);
PDFPluginPlaceholder(content::RenderFrame* render_frame,
const blink::WebPluginParams& params,
const std::string& html_data);
~PDFPluginPlaceholder() final;
// WebViewPlugin::Delegate methods:
v8::Local<v8::Value> GetV8Handle(v8::Isolate* isolate) final;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) final;
void OpenPDFCallback();