Rubber-stamped by Brady Eidson.
[webbrowser.git] / WebKitTools / WinLauncher / WinLauncher.h
blob03e9dd5d0125e67e551eb0dd4d60ea757f0dc704
1 /*
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
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.
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.
26 #pragma once
28 #include "resource.h"
29 #include <WebKit/WebKit.h>
31 class WinLauncherWebHost : public IWebFrameLoadDelegate
33 public:
34 WinLauncherWebHost() : m_refCount(1) {}
36 // IUnknown
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 *frame) { return S_OK; }
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 didReceiveIcon(
65 /* [in] */ IWebView *webView,
66 /* [in] */ OLE_HANDLE hBitmap,
67 /* [in] */ IWebFrame *frame) { return S_OK; }
69 virtual HRESULT STDMETHODCALLTYPE didFinishLoadForFrame(
70 /* [in] */ IWebView* webView,
71 /* [in] */ IWebFrame* /*frame*/) { return S_OK; }
73 virtual HRESULT STDMETHODCALLTYPE didFailLoadWithError(
74 /* [in] */ IWebView *webView,
75 /* [in] */ IWebError *error,
76 /* [in] */ IWebFrame *forFrame) { return S_OK; }
78 virtual HRESULT STDMETHODCALLTYPE didChangeLocationWithinPageForFrame(
79 /* [in] */ IWebView *webView,
80 /* [in] */ IWebFrame *frame) { return S_OK; }
82 virtual HRESULT STDMETHODCALLTYPE willPerformClientRedirectToURL(
83 /* [in] */ IWebView *webView,
84 /* [in] */ BSTR url,
85 /* [in] */ double delaySeconds,
86 /* [in] */ DATE fireDate,
87 /* [in] */ IWebFrame *frame) { return S_OK; }
89 virtual HRESULT STDMETHODCALLTYPE didCancelClientRedirectForFrame(
90 /* [in] */ IWebView *webView,
91 /* [in] */ IWebFrame *frame) { return S_OK; }
93 virtual HRESULT STDMETHODCALLTYPE willCloseFrame(
94 /* [in] */ IWebView *webView,
95 /* [in] */ IWebFrame *frame) { return S_OK; }
97 virtual /* [local] */ HRESULT STDMETHODCALLTYPE windowScriptObjectAvailable(
98 /* [in] */ IWebView *webView,
99 /* [in] */ JSContextRef context,
100 /* [in] */ JSObjectRef windowScriptObject) { return S_OK; }
102 virtual /* [local] */ HRESULT STDMETHODCALLTYPE didClearWindowObject(
103 /* [in] */ IWebView *webView,
104 /* [in] */ JSContextRef context,
105 /* [in] */ JSObjectRef windowScriptObject,
106 /* [in] */ IWebFrame *frame) { return S_OK; }
108 // WinLauncherWebHost
110 protected:
111 HRESULT updateAddressBar(IWebView* webView);
113 protected:
114 ULONG m_refCount;