Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / Source / web / FrameLoaderClientImpl.h
blob26c496effb63cb29a55721d09c195cada88fe303
1 /*
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met:
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above
12 * copyright notice, this list of conditions and the following disclaimer
13 * in the documentation and/or other materials provided with the
14 * distribution.
15 * * Neither the name of Google Inc. nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #ifndef FrameLoaderClientImpl_h
33 #define FrameLoaderClientImpl_h
35 #include "core/loader/FrameLoaderClient.h"
36 #include "platform/heap/Handle.h"
37 #include "platform/weborigin/KURL.h"
38 #include "wtf/PassOwnPtr.h"
39 #include "wtf/RefPtr.h"
41 namespace blink {
43 class WebLocalFrameImpl;
44 class WebPluginLoadObserver;
46 class FrameLoaderClientImpl final : public FrameLoaderClient {
47 public:
48 static PassOwnPtrWillBeRawPtr<FrameLoaderClientImpl> create(WebLocalFrameImpl*);
50 ~FrameLoaderClientImpl() override;
52 DECLARE_VIRTUAL_TRACE();
54 WebLocalFrameImpl* webFrame() const { return m_webFrame.get(); }
56 // FrameLoaderClient ----------------------------------------------
58 void didCreateNewDocument() override;
59 // Notifies the WebView delegate that the JS window object has been cleared,
60 // giving it a chance to bind native objects to the window before script
61 // parsing begins.
62 void dispatchDidClearWindowObjectInMainWorld() override;
63 void documentElementAvailable() override;
65 void didCreateScriptContext(v8::Local<v8::Context>, int extensionGroup, int worldId) override;
66 void willReleaseScriptContext(v8::Local<v8::Context>, int worldId) override;
68 // Returns true if we should allow the given V8 extension to be added to
69 // the script context at the currently loading page and given extension group.
70 bool allowScriptExtension(const String& extensionName, int extensionGroup, int worldId) override;
72 bool hasWebView() const override;
73 bool inShadowTree() const override;
74 Frame* opener() const override;
75 void setOpener(Frame*) override;
76 Frame* parent() const override;
77 Frame* top() const override;
78 Frame* previousSibling() const override;
79 Frame* nextSibling() const override;
80 Frame* firstChild() const override;
81 Frame* lastChild() const override;
82 void willBeDetached() override;
83 void detached(FrameDetachType) override;
84 void dispatchWillSendRequest(DocumentLoader*, unsigned long identifier, ResourceRequest&, const ResourceResponse& redirectResponse) override;
85 void dispatchDidReceiveResponse(DocumentLoader*, unsigned long identifier, const ResourceResponse&) override;
86 void dispatchDidChangeResourcePriority(unsigned long identifier, ResourceLoadPriority, int intraPriorityValue) override;
87 void dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier) override;
88 void dispatchDidLoadResourceFromMemoryCache(const ResourceRequest&, const ResourceResponse&) override;
89 void dispatchDidHandleOnloadEvents() override;
90 void dispatchDidReceiveServerRedirectForProvisionalLoad() override;
91 void dispatchDidNavigateWithinPage(HistoryItem*, HistoryCommitType) override;
92 void dispatchWillClose() override;
93 void dispatchDidStartProvisionalLoad(double triggeringEventTime) override;
94 void dispatchDidReceiveTitle(const String&) override;
95 void dispatchDidChangeIcons(IconType) override;
96 void dispatchDidCommitLoad(HistoryItem*, HistoryCommitType) override;
97 void dispatchDidFailProvisionalLoad(const ResourceError&, HistoryCommitType) override;
98 void dispatchDidFailLoad(const ResourceError&, HistoryCommitType) override;
99 void dispatchDidFinishDocumentLoad(bool documentIsEmpty) override;
100 void dispatchDidFinishLoad() override;
102 void dispatchDidChangeThemeColor() override;
103 NavigationPolicy decidePolicyForNavigation(const ResourceRequest&, DocumentLoader*, NavigationPolicy) override;
104 void dispatchWillSendSubmitEvent(HTMLFormElement*) override;
105 void dispatchWillSubmitForm(HTMLFormElement*) override;
106 void didStartLoading(LoadStartType) override;
107 void didStopLoading() override;
108 void progressEstimateChanged(double progressEstimate) override;
109 void loadURLExternally(const ResourceRequest&, NavigationPolicy, const String& suggestedName = String()) override;
110 bool navigateBackForward(int offset) const override;
111 void didAccessInitialDocument() override;
112 void didDisplayInsecureContent() override;
113 void didRunInsecureContent(SecurityOrigin*, const KURL& insecureURL) override;
114 void didDetectXSS(const KURL&, bool didBlockEntirePage) override;
115 void didDispatchPingLoader(const KURL&) override;
116 void didChangePerformanceTiming() override;
117 void selectorMatchChanged(const Vector<String>& addedSelectors, const Vector<String>& removedSelectors) override;
118 PassRefPtrWillBeRawPtr<DocumentLoader> createDocumentLoader(LocalFrame*, const ResourceRequest&, const SubstituteData&) override;
119 WTF::String userAgent(const KURL&) override;
120 WTF::String doNotTrackValue() override;
121 void transitionToCommittedForNewPage() override;
122 PassRefPtrWillBeRawPtr<LocalFrame> createFrame(const FrameLoadRequest&, const WTF::AtomicString& name, HTMLFrameOwnerElement*) override;
123 virtual bool canCreatePluginWithoutRenderer(const String& mimeType) const;
124 PassRefPtrWillBeRawPtr<Widget> createPlugin(
125 HTMLPlugInElement*, const KURL&,
126 const Vector<WTF::String>&, const Vector<WTF::String>&,
127 const WTF::String&, bool loadManually, DetachedPluginPolicy) override;
128 PassOwnPtr<WebMediaPlayer> createWebMediaPlayer(HTMLMediaElement&, const WebURL&, WebMediaPlayerClient*) override;
129 ObjectContentType objectContentType(
130 const KURL&, const WTF::String& mimeType, bool shouldPreferPlugInsForImages) override;
131 void didChangeScrollOffset() override;
132 void didUpdateCurrentHistoryItem() override;
133 void didRemoveAllPendingStylesheet() override;
134 bool allowScript(bool enabledPerSettings) override;
135 bool allowScriptFromSource(bool enabledPerSettings, const KURL& scriptURL) override;
136 bool allowPlugins(bool enabledPerSettings) override;
137 bool allowImage(bool enabledPerSettings, const KURL& imageURL) override;
138 bool allowMedia(const KURL& mediaURL) override;
139 bool allowDisplayingInsecureContent(bool enabledPerSettings, SecurityOrigin*, const KURL&) override;
140 bool allowRunningInsecureContent(bool enabledPerSettings, SecurityOrigin*, const KURL&) override;
141 void didNotAllowScript() override;
142 void didNotAllowPlugins() override;
144 WebCookieJar* cookieJar() const override;
145 bool willCheckAndDispatchMessageEvent(SecurityOrigin* target, MessageEvent*, LocalFrame* sourceFrame) const override;
146 void didChangeName(const String&) override;
147 void didChangeSandboxFlags(Frame* childFrame, SandboxFlags) override;
149 void dispatchWillOpenWebSocket(WebSocketHandle*) override;
151 void dispatchWillStartUsingPeerConnectionHandler(WebRTCPeerConnectionHandler*) override;
153 void didRequestAutocomplete(HTMLFormElement*) override;
155 bool allowWebGL(bool enabledPerSettings) override;
156 void didLoseWebGLContext(int arbRobustnessContextLostReason) override;
158 void dispatchWillInsertBody() override;
160 v8::Local<v8::Value> createTestInterface(const AtomicString& name) override;
162 PassOwnPtr<WebServiceWorkerProvider> createServiceWorkerProvider() override;
163 bool isControlledByServiceWorker(DocumentLoader&) override;
164 int64_t serviceWorkerID(DocumentLoader&) override;
165 SharedWorkerRepositoryClient* sharedWorkerRepositoryClient() override;
167 PassOwnPtr<WebApplicationCacheHost> createApplicationCacheHost(WebApplicationCacheHostClient*) override;
169 void didStopAllLoaders() override;
171 void dispatchDidChangeManifest() override;
173 unsigned backForwardLength() override;
175 void suddenTerminationDisablerChanged(bool present, SuddenTerminationDisablerType) override;
177 private:
178 explicit FrameLoaderClientImpl(WebLocalFrameImpl*);
180 bool isFrameLoaderClientImpl() const override { return true; }
182 PassOwnPtr<WebPluginLoadObserver> pluginLoadObserver(DocumentLoader*);
184 // The WebFrame that owns this object and manages its lifetime. Therefore,
185 // the web frame object is guaranteed to exist.
186 RawPtrWillBeMember<WebLocalFrameImpl> m_webFrame;
189 DEFINE_TYPE_CASTS(FrameLoaderClientImpl, FrameLoaderClient, client, client->isFrameLoaderClientImpl(), client.isFrameLoaderClientImpl());
191 } // namespace blink
193 #endif