#ifndef FrameLoaderClient_h
#define FrameLoaderClient_h
#include "core/dom/IconURL.h"
#include "core/frame/FrameClient.h"
#include "core/loader/FrameLoaderTypes.h"
#include "core/loader/NavigationPolicy.h"
#include "platform/network/ResourceLoadPriority.h"
#include "platform/weborigin/Referrer.h"
#include "wtf/Forward.h"
#include "wtf/Vector.h"
typedef class _jobject* jobject;
namespace v8 {
class Context;
template<class T> class Handle;
}
namespace blink {
class WebCookieJar;
class WebRTCPeerConnectionHandler;
class WebServiceWorkerProvider;
class WebServiceWorkerProviderClient;
class WebApplicationCacheHost;
class WebApplicationCacheHostClient;
}
namespace WebCore {
class Color;
class DOMWindowExtension;
class DOMWrapperWorld;
class DocumentLoader;
class Element;
class FetchRequest;
class FrameLoader;
class FrameNetworkingContext;
class HTMLAppletElement;
class HTMLFormElement;
class HTMLFrameOwnerElement;
class HTMLPlugInElement;
class HistoryItem;
class IntSize;
class KURL;
class LocalFrame;
class MessageEvent;
class Page;
class PluginView;
class ResourceError;
class ResourceHandle;
class ResourceRequest;
class ResourceResponse;
class SecurityOrigin;
class SharedBuffer;
class SharedWorkerRepositoryClient;
class SocketStreamHandle;
class SubstituteData;
class Widget;
class FrameLoaderClient : public FrameClient {
public:
virtual ~FrameLoaderClient() { }
virtual bool hasWebView() const = 0;
virtual void detachedFromParent() = 0;
virtual void dispatchWillRequestAfterPreconnect(ResourceRequest&) { }
virtual void dispatchWillSendRequest(DocumentLoader*, unsigned long identifier, ResourceRequest&, const ResourceResponse& redirectResponse) = 0;
virtual void dispatchDidReceiveResponse(DocumentLoader*, unsigned long identifier, const ResourceResponse&) = 0;
virtual void dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier) = 0;
virtual void dispatchDidLoadResourceFromMemoryCache(const ResourceRequest&, const ResourceResponse&) = 0;
virtual void dispatchDidHandleOnloadEvents() = 0;
virtual void dispatchDidReceiveServerRedirectForProvisionalLoad() = 0;
virtual void dispatchDidNavigateWithinPage(HistoryItem*, HistoryCommitType) { }
virtual void dispatchWillClose() = 0;
virtual void dispatchDidStartProvisionalLoad() = 0;
virtual void dispatchDidReceiveTitle(const String&) = 0;
virtual void dispatchDidChangeIcons(IconType) = 0;
virtual void dispatchDidCommitLoad(LocalFrame*, HistoryItem*, HistoryCommitType) = 0;
virtual void dispatchDidFailProvisionalLoad(const ResourceError&) = 0;
virtual void dispatchDidFailLoad(const ResourceError&) = 0;
virtual void dispatchDidFinishDocumentLoad() = 0;
virtual void dispatchDidFinishLoad() = 0;
virtual void dispatchDidFirstVisuallyNonEmptyLayout() = 0;
virtual NavigationPolicy decidePolicyForNavigation(const ResourceRequest&, DocumentLoader*, NavigationPolicy) = 0;
virtual void dispatchWillRequestResource(FetchRequest*) { }
virtual void dispatchWillSendSubmitEvent(HTMLFormElement*) = 0;
virtual void dispatchWillSubmitForm(HTMLFormElement*) = 0;
virtual void didStartLoading(LoadStartType) = 0;
virtual void progressEstimateChanged(double progressEstimate) = 0;
virtual void didStopLoading() = 0;
virtual void loadURLExternally(const ResourceRequest&, NavigationPolicy, const String& suggestedName = String()) = 0;
virtual bool navigateBackForward(int offset) const = 0;
virtual void didAccessInitialDocument() { }
virtual void didDisplayInsecureContent() = 0;
virtual void didRunInsecureContent(SecurityOrigin*, const KURL&) = 0;
virtual void didDetectXSS(const KURL&, bool didBlockEntirePage) = 0;
virtual void didDispatchPingLoader(const KURL&) = 0;
virtual void selectorMatchChanged(const Vector<String>& addedSelectors, const Vector<String>& removedSelectors) = 0;
virtual PassRefPtr<DocumentLoader> createDocumentLoader(LocalFrame*, const ResourceRequest&, const SubstituteData&) = 0;
virtual String userAgent(const KURL&) = 0;
virtual String doNotTrackValue() = 0;
virtual void transitionToCommittedForNewPage() = 0;
virtual PassRefPtr<LocalFrame> createFrame(const KURL&, const AtomicString& name, const Referrer&, HTMLFrameOwnerElement*) = 0;
enum DetachedPluginPolicy {
FailOnDetachedPlugin,
AllowDetachedPlugin,
};
virtual bool canCreatePluginWithoutRenderer(const String& mimeType) const = 0;
virtual PassRefPtr<Widget> createPlugin(HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually, DetachedPluginPolicy) = 0;
virtual PassRefPtr<Widget> createJavaAppletWidget(HTMLAppletElement*, const KURL& baseURL, const Vector<String>& paramNames, const Vector<String>& paramValues) = 0;
virtual ObjectContentType objectContentType(const KURL&, const String& mimeType, bool shouldPreferPlugInsForImages) = 0;
virtual void dispatchDidClearWindowObjectInWorld(DOMWrapperWorld&) = 0;
virtual void documentElementAvailable() = 0;
virtual void didCreateScriptContext(v8::Handle<v8::Context>, int extensionGroup, int worldId) = 0;
virtual void willReleaseScriptContext(v8::Handle<v8::Context>, int worldId) = 0;
virtual bool allowScriptExtension(const String& extensionName, int extensionGroup, int worldId) = 0;
virtual void didChangeScrollOffset() { }
virtual void didUpdateCurrentHistoryItem() { }
virtual bool allowScript(bool enabledPerSettings) { return enabledPerSettings; }
virtual bool allowScriptFromSource(bool enabledPerSettings, const KURL&) { return enabledPerSettings; }
virtual bool allowPlugins(bool enabledPerSettings) { return enabledPerSettings; }
virtual bool allowImage(bool enabledPerSettings, const KURL&) { return enabledPerSettings; }
virtual bool allowDisplayingInsecureContent(bool enabledPerSettings, SecurityOrigin*, const KURL&) { return enabledPerSettings; }
virtual bool allowRunningInsecureContent(bool enabledPerSettings, SecurityOrigin*, const KURL&) { return enabledPerSettings; }
virtual void didNotAllowScript() { }
virtual void didNotAllowPlugins() { }
virtual blink::WebCookieJar* cookieJar() const = 0;
virtual bool willCheckAndDispatchMessageEvent(SecurityOrigin* , MessageEvent*) const { return false; }
virtual void didChangeName(const String&) { }
virtual void dispatchWillOpenSocketStream(SocketStreamHandle*) { }
virtual void dispatchWillStartUsingPeerConnectionHandler(blink::WebRTCPeerConnectionHandler*) { }
virtual void didRequestAutocomplete(HTMLFormElement*) = 0;
virtual bool allowWebGL(bool enabledPerSettings) { return enabledPerSettings; }
virtual void didLoseWebGLContext(int) { }
virtual void dispatchWillInsertBody() { }
virtual void dispatchDidChangeResourcePriority(unsigned long identifier, ResourceLoadPriority, int intraPriorityValue) { }
virtual PassOwnPtr<blink::WebServiceWorkerProvider> createServiceWorkerProvider() = 0;
virtual SharedWorkerRepositoryClient* sharedWorkerRepositoryClient() { return 0; }
virtual PassOwnPtr<blink::WebApplicationCacheHost> createApplicationCacheHost(blink::WebApplicationCacheHostClient*) = 0;
virtual void didStopAllLoaders() { }
virtual bool isFrameLoaderClientImpl() const { return false; }
};
}
#endif