#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 HTMLPlugInImageElement;
class IntSize;
class KURL;
#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
class Node;
#endif
class Widget;
class SubframeLoader {
WTF_MAKE_NONCOPYABLE(SubframeLoader);
public:
explicit SubframeLoader(Frame*);
void clear();
bool requestFrame(HTMLFrameOwnerElement*, const String& url, const AtomicString& frameName, bool lockHistory = true, bool lockBackForwardList = true);
bool requestObject(HTMLPlugInImageElement*, const String& url, const AtomicString& frameName,
const String& serviceType, const Vector<String>& paramNames, const Vector<String>& paramValues);
#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
PassRefPtr<Widget> loadMediaPlayerProxyPlugin(Node*, const KURL&, const Vector<String>& paramNames, const Vector<String>& paramValues);
#endif
PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const Vector<String>& paramNames, const Vector<String>& paramValues);
bool allowPlugins(ReasonForCallingAllowPlugins);
bool containsPlugins() const { return m_containsPlugins; }
bool resourceWillUsePlugin(const String& url, const String& mimeType, bool shouldPreferPlugInsForImages);
private:
bool requestPlugin(HTMLPlugInImageElement*, const KURL&, const String& serviceType, const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback);
Frame* loadOrRedirectSubframe(HTMLFrameOwnerElement*, const KURL&, const AtomicString& frameName, bool lockHistory, bool lockBackForwardList);
Frame* loadSubframe(HTMLFrameOwnerElement*, const KURL&, const String& name, const String& referrer);
bool loadPlugin(HTMLPlugInImageElement*, const KURL&, const String& mimeType,
const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback);
bool shouldUsePlugin(const KURL&, const String& mimeType, bool shouldPreferPlugInsForImages, bool hasFallback, bool& useFallback);
bool pluginIsLoadable(HTMLPlugInImageElement*, const KURL&, const String& mimeType);
Document* document() const;
bool m_containsPlugins;
Frame* m_frame;
KURL completeURL(const String&) const;
};
}
#endif // SubframeLoader_h