Merge "Use EwkView's variables instead of drawingScaleFactor and drawingScrollPositio...
[framework/web/webkit-efl.git] / Source / WebKit2 / UIProcess / WebLoaderClient.h
1 /*
2  * Copyright (C) 2010 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
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.
12  *
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.
24  */
25
26 #ifndef WebLoaderClient_h
27 #define WebLoaderClient_h
28
29 #include "APIClient.h"
30 #include "SameDocumentNavigationType.h"
31 #include "WKPage.h"
32 #include <wtf/Forward.h>
33 #include <wtf/RefPtr.h>
34 #include <wtf/Vector.h>
35
36 namespace WebCore {
37 class ResourceError;
38 }
39
40 namespace WebKit {
41
42 class APIObject;
43 class AuthenticationChallengeProxy;
44 class AuthenticationDecisionListener;
45 class WebBackForwardListItem;
46 class WebFrameProxy;
47 class WebPageProxy;
48 class WebProtectionSpace;
49
50 #if ENABLE(WEB_INTENTS)
51 class WebIntentData;
52 #endif
53
54 #if ENABLE(WEB_INTENTS_TAG)
55 class WebIntentServiceInfo;
56 #endif
57
58 class WebLoaderClient : public APIClient<WKPageLoaderClient, kWKPageLoaderClientCurrentVersion> {
59 public:
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*);
77 #endif
78
79 #if ENABLE(WEB_INTENTS_TAG)
80     void registerIntentServiceForFrame(WebPageProxy*, WebFrameProxy*, WebIntentServiceInfo*, APIObject*);
81 #endif
82
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*);
86     
87     bool canAuthenticateAgainstProtectionSpaceInFrame(WebPageProxy*, WebFrameProxy*, WebProtectionSpace*);
88     void didReceiveAuthenticationChallengeInFrame(WebPageProxy*, WebFrameProxy*, AuthenticationChallengeProxy*);
89
90     void didStartProgress(WebPageProxy*);
91     void didChangeProgress(WebPageProxy*);
92     void didFinishProgress(WebPageProxy*);
93
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*);
99
100     void didChangeBackForwardList(WebPageProxy*, WebBackForwardListItem* addedItem, Vector<RefPtr<APIObject> >* removedItems);
101     bool shouldGoToBackForwardListItem(WebPageProxy*, WebBackForwardListItem*);
102     void willGoToBackForwardListItem(WebPageProxy*, WebBackForwardListItem*, APIObject*);
103
104     void didFailToInitializePlugin(WebPageProxy*, const String& mimeType);
105     void didBlockInsecurePluginVersion(WebPageProxy*, const String& mimeType, const String& pluginIdentifier, const String& pluginVersion);
106 };
107
108 } // namespace WebKit
109
110 #endif // WebLoaderClient_h