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 WebLoaderClient_h
27 #define WebLoaderClient_h
29 #include "APIClient.h"
30 #include "SameDocumentNavigationType.h"
32 #include <wtf/Forward.h>
33 #include <wtf/RefPtr.h>
34 #include <wtf/Vector.h>
43 class AuthenticationChallengeProxy;
44 class AuthenticationDecisionListener;
45 class WebBackForwardListItem;
48 class WebProtectionSpace;
50 #if ENABLE(WEB_INTENTS)
54 #if ENABLE(WEB_INTENTS_TAG)
55 class WebIntentServiceInfo;
58 class WebLoaderClient : public APIClient<WKPageLoaderClient, kWKPageLoaderClientCurrentVersion> {
60 void didStartProvisionalLoadForFrame(WebPageProxy*, WebFrameProxy*, APIObject*);
61 void didReceiveServerRedirectForProvisionalLoadForFrame(WebPageProxy*, WebFrameProxy*, APIObject*);
62 void didFailProvisionalLoadWithErrorForFrame(WebPageProxy*, WebFrameProxy*, const WebCore::ResourceError&, APIObject*);
63 void didCommitLoadForFrame(WebPageProxy*, WebFrameProxy*, APIObject*);
64 void didFinishDocumentLoadForFrame(WebPageProxy*, WebFrameProxy*, APIObject*);
65 void didFinishLoadForFrame(WebPageProxy*, WebFrameProxy*, APIObject*);
66 void didFailLoadWithErrorForFrame(WebPageProxy*, WebFrameProxy*, const WebCore::ResourceError&, APIObject*);
67 void didSameDocumentNavigationForFrame(WebPageProxy*, WebFrameProxy*, SameDocumentNavigationType, APIObject*);
68 void didReceiveTitleForFrame(WebPageProxy*, const String&, WebFrameProxy*, APIObject*);
69 void didFirstLayoutForFrame(WebPageProxy*, WebFrameProxy*, APIObject*);
70 void didFirstVisuallyNonEmptyLayoutForFrame(WebPageProxy*, WebFrameProxy*, APIObject*);
71 void didRemoveFrameFromHierarchy(WebPageProxy*, WebFrameProxy*, APIObject*);
72 void didDisplayInsecureContentForFrame(WebPageProxy*, WebFrameProxy*, APIObject*);
73 void didRunInsecureContentForFrame(WebPageProxy*, WebFrameProxy*, APIObject*);
74 void didDetectXSSForFrame(WebPageProxy*, WebFrameProxy*, APIObject*);
75 #if ENABLE(WEB_INTENTS)
76 void didReceiveIntentForFrame(WebPageProxy*, WebFrameProxy*, WebIntentData*, APIObject*);
79 #if ENABLE(WEB_INTENTS_TAG)
80 void registerIntentServiceForFrame(WebPageProxy*, WebFrameProxy*, WebIntentServiceInfo*, APIObject*);
83 // FIXME: didFirstVisuallyNonEmptyLayoutForFrame and didNewFirstVisuallyNonEmptyLayout should be merged.
84 // The only reason for both to exist is to experiment with different heuristics for the time being.
85 void didNewFirstVisuallyNonEmptyLayout(WebPageProxy*, APIObject*);
87 bool canAuthenticateAgainstProtectionSpaceInFrame(WebPageProxy*, WebFrameProxy*, WebProtectionSpace*);
88 void didReceiveAuthenticationChallengeInFrame(WebPageProxy*, WebFrameProxy*, AuthenticationChallengeProxy*);
90 void didStartProgress(WebPageProxy*);
91 void didChangeProgress(WebPageProxy*);
92 void didFinishProgress(WebPageProxy*);
94 // FIXME: These three functions should not be part of this client.
95 void processDidBecomeUnresponsive(WebPageProxy*);
96 void interactionOccurredWhileProcessUnresponsive(WebPageProxy*);
97 void processDidBecomeResponsive(WebPageProxy*);
98 void processDidCrash(WebPageProxy*);
100 void didChangeBackForwardList(WebPageProxy*, WebBackForwardListItem* addedItem, Vector<RefPtr<APIObject> >* removedItems);
101 bool shouldGoToBackForwardListItem(WebPageProxy*, WebBackForwardListItem*);
102 void willGoToBackForwardListItem(WebPageProxy*, WebBackForwardListItem*, APIObject*);
104 void didFailToInitializePlugin(WebPageProxy*, const String& mimeType);
105 void didBlockInsecurePluginVersion(WebPageProxy*, const String& mimeType, const String& pluginIdentifier, const String& pluginVersion);
108 } // namespace WebKit
110 #endif // WebLoaderClient_h