YouTubePluginReplacement.h [plain text]
#pragma once
#include "PluginReplacement.h"
#include <wtf/HashMap.h>
namespace WebCore {
class YouTubeEmbedShadowElement;
class YouTubePluginReplacement final : public PluginReplacement {
public:
static void registerPluginReplacement(PluginReplacementRegistrar);
typedef HashMap<String, String> KeyValueMap;
WEBCORE_EXPORT static String youTubeURLFromAbsoluteURL(const URL& srcURL, const String& srcString);
private:
YouTubePluginReplacement(HTMLPlugInElement&, const Vector<String>& paramNames, const Vector<String>& paramValues);
static Ref<PluginReplacement> create(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 bool isEnabledBySettings(const Settings&);
bool installReplacement(ShadowRoot&) final;
String youTubeURL(const String& rawURL);
bool willCreateRenderer() final { return m_embedShadowElement; }
RenderPtr<RenderElement> createElementRenderer(HTMLPlugInElement&, RenderStyle&&, const RenderTreePosition&) final;
HTMLPlugInElement* m_parentElement;
RefPtr<YouTubeEmbedShadowElement> m_embedShadowElement;
KeyValueMap m_attributes;
};
}