2
* Copyright (C) 2006 Apple Computer, 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 COMPUTER, INC. ``AS IS'' AND ANY
14
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
#include <WebKit/WebKit.h>
31
class WinLauncherWebHost : public IWebFrameLoadDelegate
34
WinLauncherWebHost() : m_refCount(1) {}
37
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
38
virtual ULONG STDMETHODCALLTYPE AddRef(void);
39
virtual ULONG STDMETHODCALLTYPE Release(void);
41
// IWebFrameLoadDelegate
42
virtual HRESULT STDMETHODCALLTYPE didStartProvisionalLoadForFrame(
43
/* [in] */ IWebView* webView,
44
/* [in] */ IWebFrame* /*frame*/) { return S_OK; }
46
virtual HRESULT STDMETHODCALLTYPE didReceiveServerRedirectForProvisionalLoadForFrame(
47
/* [in] */ IWebView *webView,
48
/* [in] */ IWebFrame *frame) { return S_OK; }
50
virtual HRESULT STDMETHODCALLTYPE didFailProvisionalLoadWithError(
51
/* [in] */ IWebView *webView,
52
/* [in] */ IWebError *error,
53
/* [in] */ IWebFrame*);
55
virtual HRESULT STDMETHODCALLTYPE didCommitLoadForFrame(
56
/* [in] */ IWebView *webView,
57
/* [in] */ IWebFrame *frame) { return updateAddressBar(webView); }
59
virtual HRESULT STDMETHODCALLTYPE didReceiveTitle(
60
/* [in] */ IWebView *webView,
61
/* [in] */ BSTR title,
62
/* [in] */ IWebFrame *frame) { return S_OK; }
64
virtual HRESULT STDMETHODCALLTYPE didChangeIcons(
65
/* [in] */ IWebView *webView,
66
/* [in] */ IWebFrame *frame) { return S_OK; }
68
virtual HRESULT STDMETHODCALLTYPE didReceiveIcon(
69
/* [in] */ IWebView *webView,
70
/* [in] */ OLE_HANDLE hBitmap,
71
/* [in] */ IWebFrame *frame) { return S_OK; }
73
virtual HRESULT STDMETHODCALLTYPE didFinishLoadForFrame(
74
/* [in] */ IWebView* webView,
75
/* [in] */ IWebFrame* /*frame*/);
77
virtual HRESULT STDMETHODCALLTYPE didFailLoadWithError(
78
/* [in] */ IWebView *webView,
79
/* [in] */ IWebError *error,
80
/* [in] */ IWebFrame *forFrame) { return S_OK; }
82
virtual HRESULT STDMETHODCALLTYPE didChangeLocationWithinPageForFrame(
83
/* [in] */ IWebView *webView,
84
/* [in] */ IWebFrame *frame) { return S_OK; }
86
virtual HRESULT STDMETHODCALLTYPE willPerformClientRedirectToURL(
87
/* [in] */ IWebView *webView,
89
/* [in] */ double delaySeconds,
90
/* [in] */ DATE fireDate,
91
/* [in] */ IWebFrame *frame) { return S_OK; }
93
virtual HRESULT STDMETHODCALLTYPE didCancelClientRedirectForFrame(
94
/* [in] */ IWebView *webView,
95
/* [in] */ IWebFrame *frame) { return S_OK; }
97
virtual HRESULT STDMETHODCALLTYPE willCloseFrame(
98
/* [in] */ IWebView *webView,
99
/* [in] */ IWebFrame *frame) { return S_OK; }
101
virtual /* [local] */ HRESULT STDMETHODCALLTYPE windowScriptObjectAvailable(
102
/* [in] */ IWebView *webView,
103
/* [in] */ JSContextRef context,
104
/* [in] */ JSObjectRef windowScriptObject) { return S_OK; }
106
virtual /* [local] */ HRESULT STDMETHODCALLTYPE didClearWindowObject(
107
/* [in] */ IWebView *webView,
108
/* [in] */ JSContextRef context,
109
/* [in] */ JSObjectRef windowScriptObject,
110
/* [in] */ IWebFrame *frame) { return S_OK; }
112
// WinLauncherWebHost
115
HRESULT updateAddressBar(IWebView* webView);