1 // Copyright 2013 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/plugins/renderer/plugin_placeholder.h"
7 #include "content/public/renderer/render_frame.h"
11 gin::WrapperInfo
PluginPlaceholder::kWrapperInfo
= {gin::kEmbedderNativeGin
};
13 PluginPlaceholder::PluginPlaceholder(content::RenderFrame
* render_frame
,
14 blink::WebLocalFrame
* frame
,
15 const blink::WebPluginParams
& params
,
16 const std::string
& html_data
,
17 GURL placeholderDataUrl
)
18 : content::RenderFrameObserver(render_frame
),
20 plugin_params_(params
),
21 plugin_(WebViewPlugin::Create(this,
22 render_frame
->GetWebkitPreferences(),
24 placeholderDataUrl
)) {
25 DCHECK(placeholderDataUrl
.is_valid())
26 << "Blink requires the placeholder to have a valid URL.";
29 PluginPlaceholder::~PluginPlaceholder() {}
31 const blink::WebPluginParams
& PluginPlaceholder::GetPluginParams() const {
32 return plugin_params_
;
35 void PluginPlaceholder::ShowContextMenu(const blink::WebMouseEvent
& event
) {
36 // Does nothing by default. Will be overridden if a specific browser wants
41 void PluginPlaceholder::PluginDestroyed() {
45 void PluginPlaceholder::OnDestruct() {
49 blink::WebLocalFrame
* PluginPlaceholder::GetFrame() { return frame_
; }
51 } // namespace plugins