1 // Copyright 2016 Samsung Electronics. 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 #ifndef EWK_EFL_INTEGRATION_RENDERER_PLUGINS_PLUGIN_PLACEHOLDER_HOLE_H_
6 #define EWK_EFL_INTEGRATION_RENDERER_PLUGINS_PLUGIN_PLACEHOLDER_HOLE_H_
10 #include "base/memory/weak_ptr.h"
11 #include "components/plugins/renderer/plugin_placeholder.h"
17 class PluginPlaceholderHole : public plugins::PluginPlaceholderBase,
18 public gin::Wrappable<PluginPlaceholderHole> {
20 static gin::WrapperInfo kWrapperInfo;
22 static bool SupportsMimeType(blink::WebLocalFrame* frame,
23 const std::string& mimetype);
25 static PluginPlaceholderHole* Create(content::RenderFrame* render_frame,
26 blink::WebLocalFrame* frame,
27 const blink::WebPluginParams& params);
30 static void SetTransparentV8Impl(
31 const v8::FunctionCallbackInfo<v8::Value>& args);
33 PluginPlaceholderHole(content::RenderFrame* render_frame,
34 blink::WebLocalFrame* frame,
35 const blink::WebPluginParams& params);
36 ~PluginPlaceholderHole() override;
38 // WebViewPlugin::Delegate method.
39 void PluginDestroyed() override;
40 v8::Local<v8::Value> GetV8Handle(v8::Isolate*) override;
41 v8::Local<v8::Object> GetV8ScriptableObject(
42 v8::Isolate* isolate) const override;
43 void OnUnobscuredRectUpdate(const gfx::Rect& unobscured_rect) override;
46 void SetTransparentHelper(bool transparent);
49 void NotifyGeometryChanged();
50 void NotitfyAttributes() const;
52 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
53 mutable v8::Persistent<v8::Object> v8_object_;
54 std::unique_ptr<cc_blink::WebLayerImpl> web_layer_;
55 gfx::Rect local_rect_;
56 gfx::Point local_position_in_root_frame_;
59 blink::WebLocalFrame* main_frame_;
61 base::WeakPtrFactory<PluginPlaceholderHole> weak_factory_;
63 DISALLOW_COPY_AND_ASSIGN(PluginPlaceholderHole);
66 #endif // EWK_EFL_INTEGRATION_RENDERER_PLUGINS_PLUGIN_PLACEHOLDER_HOLE_H_