[Telemetry] Rename test methods in page_test_results_unittest to follow existing...
[chromium-blink-merge.git] / components / plugins / renderer / plugin_placeholder.cc
blobfbdbc5069ab597626e4239d5b8ddb1a4eff1a2b6
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"
9 namespace plugins {
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),
19 frame_(frame),
20 plugin_params_(params),
21 plugin_(WebViewPlugin::Create(this,
22 render_frame->GetWebkitPreferences(),
23 html_data,
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
35 // a context menu.
36 return;
39 void PluginPlaceholder::PluginDestroyed() {
40 plugin_ = NULL;
43 void PluginPlaceholder::OnDestruct() {
44 frame_ = NULL;
47 blink::WebLocalFrame* PluginPlaceholder::GetFrame() { return frame_; }
49 } // namespace plugins