34f778498a299257dbb57f1ac79d7aca40f0adaf
[platform/framework/web/crosswalk-tizen.git] /
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.
4
5 #ifndef EWK_EFL_INTEGRATION_RENDERER_PLUGINS_PLUGIN_PLACEHOLDER_AVPLAYER_H_
6 #define EWK_EFL_INTEGRATION_RENDERER_PLUGINS_PLUGIN_PLACEHOLDER_AVPLAYER_H_
7
8 #include <string>
9
10 #include "base/macros.h"
11 #include "base/memory/weak_ptr.h"
12 #include "components/plugins/renderer/plugin_placeholder.h"
13 #include "ui/gfx/geometry/rect.h"
14
15 namespace cc_blink {
16 class WebLayerImpl;
17 }
18
19 class PluginPlaceholderAvplayer
20     : public plugins::PluginPlaceholderBase,
21       public gin::Wrappable<PluginPlaceholderAvplayer> {
22  public:
23   static gin::WrapperInfo kWrapperInfo;
24
25   static bool SupportsMimeType(const std::string& mimetype);
26
27   static PluginPlaceholderAvplayer* Create(
28       content::RenderFrame* render_frame,
29       blink::WebLocalFrame* frame,
30       const blink::WebPluginParams& params);
31
32  private:
33   PluginPlaceholderAvplayer(content::RenderFrame* render_frame,
34                             blink::WebLocalFrame* frame,
35                             const blink::WebPluginParams& params);
36   ~PluginPlaceholderAvplayer() override;
37
38   // WebViewPlugin::Delegate method.
39   v8::Local<v8::Value> GetV8Handle(v8::Isolate*) override;
40   void OnUnobscuredRectUpdate(const gfx::Rect& unobscured_rect) override;
41   void NotifyTransparentChanged();
42
43   std::unique_ptr<cc_blink::WebLayerImpl> web_layer_;
44   gfx::Rect local_rect_;
45
46   DISALLOW_COPY_AND_ASSIGN(PluginPlaceholderAvplayer);
47 };
48
49 #endif  // EWK_EFL_INTEGRATION_RENDERER_PLUGINS_PLUGIN_PLACEHOLDER_AVPLAYER_H_