YouTubePluginReplacement.h [plain text]
#ifndef YouTubePluginReplacement_h
#define YouTubePluginReplacement_h
#include "PluginReplacement.h"
#include <wtf/HashMap.h>
#include <wtf/RetainPtr.h>
namespace WebCore {
class HTMLPlugInElement;
class HTMLIFrameElement;
class RenderElement;
class RenderStyle;
class ShadowRoot;
class YouTubeEmbedShadowElement;
class YouTubePluginReplacement : public PluginReplacement {
public:
static void registerPluginReplacement(PluginReplacementRegistrar);
typedef HashMap<String, String> KeyValueMap;
private:
YouTubePluginReplacement(HTMLPlugInElement&, const Vector<String>& paramNames, const Vector<String>& paramValues);
static bool supportsMimeType(const String&);
static bool supportsFileExtension(const String&);
static bool supportsURL(const URL&);
static PassRefPtr<PluginReplacement> create(HTMLPlugInElement&, const Vector<String>& paramNames, const Vector<String>& paramValues);
virtual bool installReplacement(ShadowRoot*) override;
String youTubeURL(const String& rawURL);
virtual bool willCreateRenderer() override { return m_embedShadowElement; }
virtual RenderPtr<RenderElement> createElementRenderer(HTMLPlugInElement&, Ref<RenderStyle>&&, const RenderTreePosition&) override;
HTMLPlugInElement* m_parentElement;
RefPtr<YouTubeEmbedShadowElement> m_embedShadowElement;
KeyValueMap m_attributes;
};
}
#endif