|
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 FrameLoaderDelegate_h |
|
30 #define FrameLoaderDelegate_h |
|
31 |
|
32 #include <WebKit/IWebFrameLoadDelegate.h> |
|
33 #include <wtf/OwnPtr.h> |
|
34 |
|
35 class GCController; |
|
36 |
|
37 class FrameLoadDelegate : public IWebFrameLoadDelegate { |
|
38 public: |
|
39 FrameLoadDelegate(); |
|
40 virtual ~FrameLoadDelegate(); |
|
41 |
|
42 void processWork(); |
|
43 |
|
44 // IUnknown |
|
45 virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject); |
|
46 virtual ULONG STDMETHODCALLTYPE AddRef(void); |
|
47 virtual ULONG STDMETHODCALLTYPE Release(void); |
|
48 |
|
49 // IWebFrameLoadDelegate |
|
50 virtual HRESULT STDMETHODCALLTYPE didStartProvisionalLoadForFrame( |
|
51 /* [in] */ IWebView *webView, |
|
52 /* [in] */ IWebFrame *frame); |
|
53 |
|
54 virtual HRESULT STDMETHODCALLTYPE didReceiveServerRedirectForProvisionalLoadForFrame( |
|
55 /* [in] */ IWebView *webView, |
|
56 /* [in] */ IWebFrame *frame) { return E_NOTIMPL; } |
|
57 |
|
58 virtual HRESULT STDMETHODCALLTYPE didFailProvisionalLoadWithError( |
|
59 /* [in] */ IWebView *webView, |
|
60 /* [in] */ IWebError *error, |
|
61 /* [in] */ IWebFrame *frame) { return E_NOTIMPL; } |
|
62 |
|
63 virtual HRESULT STDMETHODCALLTYPE didCommitLoadForFrame( |
|
64 /* [in] */ IWebView *webView, |
|
65 /* [in] */ IWebFrame *frame); |
|
66 |
|
67 virtual HRESULT STDMETHODCALLTYPE didReceiveTitle( |
|
68 /* [in] */ IWebView *webView, |
|
69 /* [in] */ BSTR title, |
|
70 /* [in] */ IWebFrame *frame); |
|
71 |
|
72 virtual HRESULT STDMETHODCALLTYPE didReceiveIcon( |
|
73 /* [in] */ IWebView *webView, |
|
74 /* [in] */ OLE_HANDLE image, |
|
75 /* [in] */ IWebFrame *frame) { return E_NOTIMPL; } |
|
76 |
|
77 virtual HRESULT STDMETHODCALLTYPE didFinishLoadForFrame( |
|
78 /* [in] */ IWebView *webView, |
|
79 /* [in] */ IWebFrame *frame); |
|
80 |
|
81 virtual HRESULT STDMETHODCALLTYPE didFailLoadWithError( |
|
82 /* [in] */ IWebView *webView, |
|
83 /* [in] */ IWebError *error, |
|
84 /* [in] */ IWebFrame *forFrame); |
|
85 |
|
86 virtual HRESULT STDMETHODCALLTYPE didChangeLocationWithinPageForFrame( |
|
87 /* [in] */ IWebView *webView, |
|
88 /* [in] */ IWebFrame *frame) { return E_NOTIMPL; } |
|
89 |
|
90 virtual HRESULT STDMETHODCALLTYPE willPerformClientRedirectToURL( |
|
91 /* [in] */ IWebView *webView, |
|
92 /* [in] */ BSTR url, |
|
93 /* [in] */ double delaySeconds, |
|
94 /* [in] */ DATE fireDate, |
|
95 /* [in] */ IWebFrame *frame) { return E_NOTIMPL; } |
|
96 |
|
97 virtual HRESULT STDMETHODCALLTYPE didCancelClientRedirectForFrame( |
|
98 /* [in] */ IWebView *webView, |
|
99 /* [in] */ IWebFrame *frame) { return E_NOTIMPL; } |
|
100 |
|
101 virtual HRESULT STDMETHODCALLTYPE willCloseFrame( |
|
102 /* [in] */ IWebView *webView, |
|
103 /* [in] */ IWebFrame *frame) { return E_NOTIMPL; } |
|
104 |
|
105 virtual HRESULT STDMETHODCALLTYPE windowScriptObjectAvailable( |
|
106 /* [in] */ IWebView *sender, |
|
107 /* [in] */ JSContextRef context, |
|
108 /* [in] */ JSObjectRef windowObject); |
|
109 |
|
110 protected: |
|
111 void locationChangeDone(IWebError*, IWebFrame*); |
|
112 |
|
113 ULONG m_refCount; |
|
114 OwnPtr<GCController> m_gcController; |
|
115 }; |
|
116 |
|
117 #endif // FrameLoaderDelegate_h |