UserContentController.h [plain text]
#ifndef UserContentController_h
#define UserContentController_h
#include "UserContentProvider.h"
namespace WebCore {
class UserContentController final : public UserContentProvider {
public:
WEBCORE_EXPORT static Ref<UserContentController> create();
WEBCORE_EXPORT ~UserContentController();
WEBCORE_EXPORT void addUserScript(DOMWrapperWorld&, std::unique_ptr<UserScript>);
WEBCORE_EXPORT void removeUserScript(DOMWrapperWorld&, const URL&);
WEBCORE_EXPORT void removeUserScripts(DOMWrapperWorld&);
WEBCORE_EXPORT void addUserStyleSheet(DOMWrapperWorld&, std::unique_ptr<UserStyleSheet>, UserStyleInjectionTime);
WEBCORE_EXPORT void removeUserStyleSheet(DOMWrapperWorld&, const URL&);
WEBCORE_EXPORT void removeUserStyleSheets(DOMWrapperWorld&);
WEBCORE_EXPORT void removeAllUserContent();
private:
UserContentController();
void forEachUserScript(const std::function<void(DOMWrapperWorld&, const UserScript&)>&) const override;
void forEachUserStyleSheet(const std::function<void(const UserStyleSheet&)>&) const override;
#if ENABLE(USER_MESSAGE_HANDLERS)
void forEachUserMessageHandler(const std::function<void(const UserMessageHandlerDescriptor&)>&) const override;
#endif
#if ENABLE(CONTENT_EXTENSIONS)
ContentExtensions::ContentExtensionsBackend& userContentExtensionBackend() override { return m_contentExtensionBackend; }
#endif
UserScriptMap m_userScripts;
UserStyleSheetMap m_userStyleSheets;
#if ENABLE(CONTENT_EXTENSIONS)
ContentExtensions::ContentExtensionsBackend m_contentExtensionBackend;
#endif
};
}
#endif // UserContentController_h