• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2005, 2006, 2007 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  *
8  * 1.  Redistributions of source code must retain the above copyright
9  *     notice, this list of conditions and the following disclaimer.
10  * 2.  Redistributions in binary form must reproduce the above copyright
11  *     notice, this list of conditions and the following disclaimer in the
12  *     documentation and/or other materials provided with the distribution.
13  * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
14  *     its contributors may be used to endorse or promote products derived
15  *     from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef FrameLoadDelegate_h
30 #define FrameLoadDelegate_h
31 
32 #include <WebKit/WebKit.h>
33 #include <wtf/OwnPtr.h>
34 
35 class AccessibilityController;
36 class GCController;
37 
38 class FrameLoadDelegate : public IWebFrameLoadDelegate, public IWebFrameLoadDelegatePrivate {
39 public:
40     FrameLoadDelegate();
41     virtual ~FrameLoadDelegate();
42 
43     void processWork();
44 
45     // IUnknown
46     virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
47     virtual ULONG STDMETHODCALLTYPE AddRef(void);
48     virtual ULONG STDMETHODCALLTYPE Release(void);
49 
50     // IWebFrameLoadDelegate
51     virtual HRESULT STDMETHODCALLTYPE didStartProvisionalLoadForFrame(
52         /* [in] */ IWebView *webView,
53         /* [in] */ IWebFrame *frame);
54 
55     virtual HRESULT STDMETHODCALLTYPE didReceiveServerRedirectForProvisionalLoadForFrame(
56         /* [in] */ IWebView *webView,
57         /* [in] */ IWebFrame *frame);
58 
59     virtual HRESULT STDMETHODCALLTYPE didFailProvisionalLoadWithError(
60         /* [in] */ IWebView *webView,
61         /* [in] */ IWebError *error,
62         /* [in] */ IWebFrame *frame);
63 
64     virtual HRESULT STDMETHODCALLTYPE didCommitLoadForFrame(
65         /* [in] */ IWebView *webView,
66         /* [in] */ IWebFrame *frame);
67 
68     virtual HRESULT STDMETHODCALLTYPE didReceiveTitle(
69         /* [in] */ IWebView *webView,
70         /* [in] */ BSTR title,
71         /* [in] */ IWebFrame *frame);
72 
didReceiveIcon(IWebView * webView,OLE_HANDLE image,IWebFrame * frame)73     virtual HRESULT STDMETHODCALLTYPE didReceiveIcon(
74         /* [in] */ IWebView *webView,
75         /* [in] */ OLE_HANDLE image,
76         /* [in] */ IWebFrame *frame) { return E_NOTIMPL; }
77 
78     virtual HRESULT STDMETHODCALLTYPE didFinishLoadForFrame(
79         /* [in] */ IWebView *webView,
80         /* [in] */ IWebFrame *frame);
81 
82     virtual HRESULT STDMETHODCALLTYPE didFailLoadWithError(
83         /* [in] */ IWebView *webView,
84         /* [in] */ IWebError *error,
85         /* [in] */ IWebFrame *forFrame);
86 
didChangeLocationWithinPageForFrame(IWebView * webView,IWebFrame * frame)87     virtual HRESULT STDMETHODCALLTYPE didChangeLocationWithinPageForFrame(
88         /* [in] */ IWebView *webView,
89         /* [in] */ IWebFrame *frame) { return E_NOTIMPL; }
90 
91     virtual HRESULT STDMETHODCALLTYPE willPerformClientRedirectToURL(
92         /* [in] */ IWebView *webView,
93         /* [in] */ BSTR url,
94         /* [in] */ double delaySeconds,
95         /* [in] */ DATE fireDate,
96         /* [in] */ IWebFrame *frame);
97 
98     virtual HRESULT STDMETHODCALLTYPE didCancelClientRedirectForFrame(
99         /* [in] */ IWebView *webView,
100         /* [in] */ IWebFrame *frame);
101 
102     virtual HRESULT STDMETHODCALLTYPE willCloseFrame(
103         /* [in] */ IWebView *webView,
104         /* [in] */ IWebFrame *frame);
105 
windowScriptObjectAvailable(IWebView * sender,JSContextRef context,JSObjectRef windowObject)106     virtual HRESULT STDMETHODCALLTYPE windowScriptObjectAvailable(
107         /* [in] */ IWebView *sender,
108         /* [in] */ JSContextRef context,
109         /* [in] */ JSObjectRef windowObject) { return E_NOTIMPL; }
110 
111     virtual /* [local] */ HRESULT STDMETHODCALLTYPE didClearWindowObject(
112         /* [in] */ IWebView* webView,
113         /* [in] */ JSContextRef context,
114         /* [in] */ JSObjectRef windowObject,
115         /* [in] */ IWebFrame* frame);
116 
117     // IWebFrameLoadDelegatePrivate
118     virtual HRESULT STDMETHODCALLTYPE didFinishDocumentLoadForFrame(
119         /* [in] */ IWebView *sender,
120         /* [in] */ IWebFrame *frame);
121 
didFirstLayoutInFrame(IWebView * sender,IWebFrame * frame)122     virtual HRESULT STDMETHODCALLTYPE didFirstLayoutInFrame(
123         /* [in] */ IWebView *sender,
124         /* [in] */ IWebFrame *frame) { return E_NOTIMPL; }
125 
126     virtual HRESULT STDMETHODCALLTYPE didHandleOnloadEventsForFrame(
127         /* [in] */ IWebView *sender,
128         /* [in] */ IWebFrame *frame);
129 
130     virtual HRESULT STDMETHODCALLTYPE didFirstVisuallyNonEmptyLayoutInFrame(
131         /* [in] */ IWebView *sender,
132         /* [in] */ IWebFrame *frame);
133 
134 protected:
135     void locationChangeDone(IWebError*, IWebFrame*);
136 
137     ULONG m_refCount;
138     OwnPtr<GCController> m_gcController;
139     OwnPtr<AccessibilityController> m_accessibilityController;
140 };
141 
142 #endif // FrameLoadDelegate_h
143