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
)) {
27 PluginPlaceholder::~PluginPlaceholder() {}
29 const blink::WebPluginParams
& PluginPlaceholder::GetPluginParams() const {
30 return plugin_params_
;
33 void PluginPlaceholder::ShowContextMenu(const blink::WebMouseEvent
& event
) {
34 // Does nothing by default. Will be overridden if a specific browser wants
39 void PluginPlaceholder::PluginDestroyed() {
43 void PluginPlaceholder::OnDestruct() {
47 blink::WebLocalFrame
* PluginPlaceholder::GetFrame() { return frame_
; }
49 } // namespace plugins