2 * Copyright (C) 2010 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
26 #ifndef WebFrameProxy_h
27 #define WebFrameProxy_h
29 #include "APIObject.h"
30 #include "ImmutableArray.h"
31 #include "GenericCallback.h"
32 #include "WebFrameListenerProxy.h"
33 #include <WebCore/FrameLoaderTypes.h>
34 #include <wtf/Forward.h>
35 #include <wtf/PassRefPtr.h>
36 #include <wtf/text/WTFString.h>
38 #if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
39 #include "AuthenticationChallengeProxy.h"
43 class ArgumentDecoder;
51 class PlatformCertificateInfo;
52 class WebCertificateInfo;
53 class WebFormSubmissionListenerProxy;
54 class WebFramePolicyListenerProxy;
57 #if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
58 class WebProcessProxy;
61 typedef GenericCallback<WKDataRef> DataCallback;
63 class WebFrameProxy : public APIObject {
65 static const Type APIType = TypeFrame;
67 static PassRefPtr<WebFrameProxy> create(WebPageProxy* page, uint64_t frameID)
69 return adoptRef(new WebFrameProxy(page, frameID));
72 virtual ~WebFrameProxy();
80 uint64_t frameID() const { return m_frameID; }
81 WebPageProxy* page() const { return m_page; }
83 WebFrameProxy* parentFrame() { return m_parentFrame; }
84 WebFrameProxy* nextSibling() { return m_nextSibling; }
85 WebFrameProxy* previousSibling() { return m_previousSibling; }
86 WebFrameProxy* firstChild() { return m_firstChild; }
87 WebFrameProxy* lastChild() { return m_lastChild; }
91 bool isMainFrame() const;
93 void setIsFrameSet(bool value) { m_isFrameSet = value; }
94 bool isFrameSet() const { return m_isFrameSet; }
96 LoadState loadState() const { return m_loadState; }
98 void stopLoading() const;
100 const String& url() const { return m_url; }
101 const String& provisionalURL() const { return m_provisionalURL; }
103 void setUnreachableURL(const String&);
104 const String& unreachableURL() const { return m_unreachableURL; }
106 const String& mimeType() const { return m_MIMEType; }
108 const String& title() const { return m_title; }
110 WebCertificateInfo* certificateInfo() const { return m_certificateInfo.get(); }
112 bool canProvideSource() const;
113 bool canShowMIMEType(const String& mimeType) const;
115 bool isDisplayingStandaloneImageDocument() const;
116 bool isDisplayingMarkupDocument() const;
117 bool isDisplayingPDFDocument() const;
119 void getWebArchive(PassRefPtr<DataCallback>);
120 void getMainResourceData(PassRefPtr<DataCallback>);
121 void getResourceData(WebURL*, PassRefPtr<DataCallback>);
123 void didStartProvisionalLoad(const String& url);
124 void didReceiveServerRedirectForProvisionalLoad(const String& url);
125 void didFailProvisionalLoad();
126 void didCommitLoad(const String& contentType, const PlatformCertificateInfo&);
127 void didFinishLoad();
129 void didSameDocumentNavigation(const String&); // eg. anchor navigation, session state change.
130 void didChangeTitle(const String&);
132 // Frame tree operations.
133 void appendChild(WebFrameProxy*);
134 void removeChild(WebFrameProxy*);
135 void didRemoveFromHierarchy();
136 PassRefPtr<ImmutableArray> childFrames();
137 bool isDescendantOf(const WebFrameProxy* ancestor) const;
138 void dumpFrameTreeToSTDOUT(unsigned indent = 0);
140 // Policy operations.
141 void receivedPolicyDecision(WebCore::PolicyAction, uint64_t listenerID);
142 WebFramePolicyListenerProxy* setUpPolicyListenerProxy(uint64_t listenerID);
143 WebFormSubmissionListenerProxy* setUpFormSubmissionListenerProxy(uint64_t listenerID);
144 #if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
145 AuthenticationChallengeProxy* setUpAuthenticationChallengeProxy(const WebCore::AuthenticationChallenge& authenticationChallenge, uint64_t challengeID, WebProcessProxy* process);
149 WebFrameProxy(WebPageProxy* page, uint64_t frameID);
151 virtual Type type() const { return APIType; }
153 WebPageProxy* m_page;
154 WebFrameProxy* m_parentFrame;
155 WebFrameProxy* m_nextSibling;
156 WebFrameProxy* m_previousSibling;
157 WebFrameProxy* m_firstChild;
158 WebFrameProxy* m_lastChild;
160 LoadState m_loadState;
162 String m_provisionalURL;
163 String m_unreachableURL;
164 String m_lastUnreachableURL;
168 RefPtr<WebCertificateInfo> m_certificateInfo;
169 RefPtr<WebFrameListenerProxy> m_activeListener;
171 #if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
172 RefPtr<AuthenticationChallengeProxy> m_activeAuthenticationChallenge;
176 } // namespace WebKit
178 #endif // WebFrameProxy_h