#ifndef SubframeLoader_h
#define SubframeLoader_h
#include "FrameLoaderTypes.h"
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/Noncopyable.h>
#include <wtf/Vector.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
class Document;
class Frame;
class FrameLoaderClient;
class HTMLAppletElement;
class HTMLFrameOwnerElement;
class HTMLMediaElement;
class HTMLPlugInImageElement;
class IntSize;
class URL;
class Widget;
class SubframeLoader {
WTF_MAKE_NONCOPYABLE(SubframeLoader); WTF_MAKE_FAST_ALLOCATED;
public:
explicit SubframeLoader(Frame&);
void clear();
bool requestFrame(HTMLFrameOwnerElement&, const String& url, const AtomicString& frameName, LockHistory = LockHistory::Yes, LockBackForwardList = LockBackForwardList::Yes);
bool requestObject(HTMLPlugInImageElement&, const String& url, const AtomicString& frameName,
const String& serviceType, const Vector<String>& paramNames, const Vector<String>& paramValues);
PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement&, const Vector<String>& paramNames, const Vector<String>& paramValues);
WEBCORE_EXPORT bool allowPlugins();
bool containsPlugins() const { return m_containsPlugins; }
bool resourceWillUsePlugin(const String& url, const String& mimeType);
private:
bool requestPlugin(HTMLPlugInImageElement&, const URL&, const String& serviceType, const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback);
Frame* loadOrRedirectSubframe(HTMLFrameOwnerElement&, const URL&, const AtomicString& frameName, LockHistory, LockBackForwardList);
Frame* loadSubframe(HTMLFrameOwnerElement&, const URL&, const String& name, const String& referrer);
bool loadPlugin(HTMLPlugInImageElement&, const URL&, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback);
bool isPluginContentAllowedByContentSecurityPolicy(HTMLPlugInImageElement&, const URL&, const String& mimeType) const;
bool shouldUsePlugin(const URL&, const String& mimeType, bool hasFallback, bool& useFallback);
bool pluginIsLoadable(HTMLPlugInImageElement&, const URL&, const String& mimeType);
Document* document() const;
bool shouldConvertInvalidURLsToBlank() const;
bool m_containsPlugins;
Frame& m_frame;
URL completeURL(const String&) const;
};
}
#endif // SubframeLoader_h