2006-06-03 Steve Falkenburg <sfalken@apple.com>
authorsfalken <sfalken@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 3 Jun 2006 07:15:42 +0000 (07:15 +0000)
committersfalken <sfalken@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 3 Jun 2006 07:15:42 +0000 (07:15 +0000)
        Reviewed by hyatt.

        Switch Spinneret to new hosting mechanism

        * Spinneret/Spinneret.sln:
        * Spinneret/Spinneret/Spinneret.cpp:
        (SpinneretWebHost::updateAddressBar):
        (SpinneretWebHost::QueryInterface):
        (SpinneretWebHost::AddRef):
        (SpinneretWebHost::Release):
        (resizeSubViews):
        (_tWinMain):
        (WndProc):
        (MyEditProc):
        (About):
        (loadURL):
        * Spinneret/Spinneret/Spinneret.h:
        (SpinneretWebHost::didStartProvisionalLoadForFrame):
        (SpinneretWebHost::didReceiveServerRedirectForProvisionalLoadForFrame):
        (SpinneretWebHost::didFailProvisionalLoadWithError):
        (SpinneretWebHost::didCommitLoadForFrame):
        (SpinneretWebHost::didReceiveTitle):
        (SpinneretWebHost::didReceiveIcon):
        (SpinneretWebHost::didFinishLoadForFrame):
        (SpinneretWebHost::didFailLoadWithError):
        (SpinneretWebHost::didChangeLocationWithinPageForFrame):
        (SpinneretWebHost::willPerformClientRedirectToURL):
        (SpinneretWebHost::didCancelClientRedirectForFrame):
        (SpinneretWebHost::willCloseFrame):
        (SpinneretWebHost::windowScriptObjectAvailable):
        * Spinneret/Spinneret/Spinneret.vcproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14708 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitTools/ChangeLog
WebKitTools/Spinneret/Spinneret.sln
WebKitTools/Spinneret/Spinneret/Spinneret.cpp
WebKitTools/Spinneret/Spinneret/Spinneret.h
WebKitTools/Spinneret/Spinneret/Spinneret.vcproj

index 4f257c9..f211340 100644 (file)
@@ -1,3 +1,37 @@
+2006-06-03  Steve Falkenburg  <sfalken@apple.com>
+
+        Reviewed by hyatt.
+        
+        Switch Spinneret to new hosting mechanism
+
+        * Spinneret/Spinneret.sln:
+        * Spinneret/Spinneret/Spinneret.cpp:
+        (SpinneretWebHost::updateAddressBar):
+        (SpinneretWebHost::QueryInterface):
+        (SpinneretWebHost::AddRef):
+        (SpinneretWebHost::Release):
+        (resizeSubViews):
+        (_tWinMain):
+        (WndProc):
+        (MyEditProc):
+        (About):
+        (loadURL):
+        * Spinneret/Spinneret/Spinneret.h:
+        (SpinneretWebHost::didStartProvisionalLoadForFrame):
+        (SpinneretWebHost::didReceiveServerRedirectForProvisionalLoadForFrame):
+        (SpinneretWebHost::didFailProvisionalLoadWithError):
+        (SpinneretWebHost::didCommitLoadForFrame):
+        (SpinneretWebHost::didReceiveTitle):
+        (SpinneretWebHost::didReceiveIcon):
+        (SpinneretWebHost::didFinishLoadForFrame):
+        (SpinneretWebHost::didFailLoadWithError):
+        (SpinneretWebHost::didChangeLocationWithinPageForFrame):
+        (SpinneretWebHost::willPerformClientRedirectToURL):
+        (SpinneretWebHost::didCancelClientRedirectForFrame):
+        (SpinneretWebHost::willCloseFrame):
+        (SpinneretWebHost::windowScriptObjectAvailable):
+        * Spinneret/Spinneret/Spinneret.vcproj:
+
 2006-06-02  Steve Falkenburg  <sfalken@apple.com>
 
         Reviewed by darin.
index 9e42955..bd8e97e 100755 (executable)
@@ -3,7 +3,8 @@ Microsoft Visual Studio Solution File, Format Version 9.00
 # Visual Studio 2005\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Spinneret", "Spinneret\Spinneret.vcproj", "{114FCA11-216B-4C8C-957E-30A75AE80443}"\r
        ProjectSection(ProjectDependencies) = postProject\r
-               {ACFF36C9-2C1B-4404-B6AC-0CA9F2901B4D} = {ACFF36C9-2C1B-4404-B6AC-0CA9F2901B4D}\r
+               {B8437A41-67BC-4769-9452-45203827F821} = {B8437A41-67BC-4769-9452-45203827F821}\r
+               {0662A8A9-82A3-4638-97D8-EC425D8D87C9} = {0662A8A9-82A3-4638-97D8-EC425D8D87C9}\r
        EndProjectSection\r
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JavaScriptCore", "..\..\JavaScriptCore\JavaScriptCore.vcproj\JavaScriptCore\JavaScriptCore.vcproj", "{011D10F1-B656-4A1B-A0C3-3842F02122C5}"\r
@@ -16,13 +17,22 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebCore", "..\..\WebCore\We
                {011D10F1-B656-4A1B-A0C3-3842F02122C5} = {011D10F1-B656-4A1B-A0C3-3842F02122C5}\r
        EndProjectSection\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebKitWin", "..\..\WebKitWin\WebKitWin.vcproj\WebKitWin\WebKitWin.vcproj", "{ACFF36C9-2C1B-4404-B6AC-0CA9F2901B4D}"\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dftables", "..\..\JavaScriptCore\JavaScriptCore.vcproj\dftables\dftables.vcproj", "{BC2981C0-67A5-4A3C-879B-784BCBDE2541}"\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Interfaces", "..\..\WebKit\WebKit.vcproj\Interfaces.vcproj", "{91762BE2-87EF-4F5A-A480-48B90EB3F406}"\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebKitGUID", "..\..\WebKit\WebKit.vcproj\WebKitGUID.vcproj", "{B8437A41-67BC-4769-9452-45203827F821}"\r
        ProjectSection(ProjectDependencies) = postProject\r
-               {011D10F1-B656-4A1B-A0C3-3842F02122C5} = {011D10F1-B656-4A1B-A0C3-3842F02122C5}\r
-               {1C16337B-ACF3-4D03-AA90-851C5B5EADA6} = {1C16337B-ACF3-4D03-AA90-851C5B5EADA6}\r
+               {91762BE2-87EF-4F5A-A480-48B90EB3F406} = {91762BE2-87EF-4F5A-A480-48B90EB3F406}\r
        EndProjectSection\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dftables", "..\..\JavaScriptCore\JavaScriptCore.vcproj\dftables\dftables.vcproj", "{BC2981C0-67A5-4A3C-879B-784BCBDE2541}"\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebKit", "..\..\WebKit\WebKit.vcproj\WebKit.vcproj", "{0662A8A9-82A3-4638-97D8-EC425D8D87C9}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {B8437A41-67BC-4769-9452-45203827F821} = {B8437A41-67BC-4769-9452-45203827F821}\r
+               {1C16337B-ACF3-4D03-AA90-851C5B5EADA6} = {1C16337B-ACF3-4D03-AA90-851C5B5EADA6}\r
+               {91762BE2-87EF-4F5A-A480-48B90EB3F406} = {91762BE2-87EF-4F5A-A480-48B90EB3F406}\r
+               {011D10F1-B656-4A1B-A0C3-3842F02122C5} = {011D10F1-B656-4A1B-A0C3-3842F02122C5}\r
+       EndProjectSection\r
 EndProject\r
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
@@ -42,14 +52,22 @@ Global
                {1C16337B-ACF3-4D03-AA90-851C5B5EADA6}.Debug|Win32.Build.0 = Debug|Win32\r
                {1C16337B-ACF3-4D03-AA90-851C5B5EADA6}.Release|Win32.ActiveCfg = Release|Win32\r
                {1C16337B-ACF3-4D03-AA90-851C5B5EADA6}.Release|Win32.Build.0 = Release|Win32\r
-               {ACFF36C9-2C1B-4404-B6AC-0CA9F2901B4D}.Debug|Win32.ActiveCfg = Debug|Win32\r
-               {ACFF36C9-2C1B-4404-B6AC-0CA9F2901B4D}.Debug|Win32.Build.0 = Debug|Win32\r
-               {ACFF36C9-2C1B-4404-B6AC-0CA9F2901B4D}.Release|Win32.ActiveCfg = Release|Win32\r
-               {ACFF36C9-2C1B-4404-B6AC-0CA9F2901B4D}.Release|Win32.Build.0 = Release|Win32\r
                {BC2981C0-67A5-4A3C-879B-784BCBDE2541}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {BC2981C0-67A5-4A3C-879B-784BCBDE2541}.Debug|Win32.Build.0 = Debug|Win32\r
                {BC2981C0-67A5-4A3C-879B-784BCBDE2541}.Release|Win32.ActiveCfg = Release|Win32\r
                {BC2981C0-67A5-4A3C-879B-784BCBDE2541}.Release|Win32.Build.0 = Release|Win32\r
+               {91762BE2-87EF-4F5A-A480-48B90EB3F406}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {91762BE2-87EF-4F5A-A480-48B90EB3F406}.Debug|Win32.Build.0 = Debug|Win32\r
+               {91762BE2-87EF-4F5A-A480-48B90EB3F406}.Release|Win32.ActiveCfg = Release|Win32\r
+               {91762BE2-87EF-4F5A-A480-48B90EB3F406}.Release|Win32.Build.0 = Release|Win32\r
+               {B8437A41-67BC-4769-9452-45203827F821}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {B8437A41-67BC-4769-9452-45203827F821}.Debug|Win32.Build.0 = Debug|Win32\r
+               {B8437A41-67BC-4769-9452-45203827F821}.Release|Win32.ActiveCfg = Release|Win32\r
+               {B8437A41-67BC-4769-9452-45203827F821}.Release|Win32.Build.0 = Release|Win32\r
+               {0662A8A9-82A3-4638-97D8-EC425D8D87C9}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {0662A8A9-82A3-4638-97D8-EC425D8D87C9}.Debug|Win32.Build.0 = Debug|Win32\r
+               {0662A8A9-82A3-4638-97D8-EC425D8D87C9}.Release|Win32.ActiveCfg = Release|Win32\r
+               {0662A8A9-82A3-4638-97D8-EC425D8D87C9}.Release|Win32.Build.0 = Release|Win32\r
        EndGlobalSection\r
        GlobalSection(SolutionProperties) = preSolution\r
                HideSolutionNode = FALSE\r
index ece9e81..f8dac5b 100755 (executable)
 
 #include "stdafx.h"
 #include "Spinneret.h"
-#include "WebView.h"
-#include "WebFrame.h"
+#include "IWebView.h"
+#include "IWebFrame.h"
+#include "WebKit.h"
 
 #include <commctrl.h>
 #include <objbase.h>
+#include <shlwapi.h>
+#include <wininet.h>
 
 #define MAX_LOADSTRING 100
 #define URLBAR_HEIGHT  24
 
-using namespace WebKit;
-
 // Global Variables:
 HINSTANCE hInst;                                // current instance
 HWND hMainWnd;
 HWND hURLBarWnd;
 long DefEditProc;
-WebView* gWebView = 0;
-WebHost* gWebHost = 0;
+IWebView* gWebView = 0;
+HWND gViewWindow = 0;
+SpinneretWebHost* gWebHost = 0;
 TCHAR szTitle[MAX_LOADSTRING];                    // The title bar text
 TCHAR szWindowClass[MAX_LOADSTRING];            // the main window class name
 
@@ -53,13 +55,74 @@ LRESULT CALLBACK    WndProc(HWND, UINT, WPARAM, LPARAM);
 INT_PTR CALLBACK    About(HWND, UINT, WPARAM, LPARAM);
 LRESULT CALLBACK    MyEditProc(HWND, UINT, WPARAM, LPARAM);
 
-void SpinneretWebHost::updateLocationBar(const char* URL)
+static void loadURL(BSTR urlBStr);
+
+HRESULT SpinneretWebHost::updateAddressBar(IWebView* webView)
+{
+    IWebFrame* mainFrame = 0;
+    IWebDataSource* dataSource = 0;
+    IWebMutableURLRequest* request = 0;
+    BSTR frameURL = 0;
+
+    HRESULT hr = S_OK;
+
+    hr = webView->mainFrame(&mainFrame);
+    if (FAILED(hr))
+        goto exit;
+
+    hr = mainFrame->dataSource(&dataSource);
+    if (FAILED(hr) || !dataSource)
+        hr = mainFrame->provisionalDataSource(&dataSource);
+    if (FAILED(hr) || !dataSource)
+        goto exit;
+
+    hr = dataSource->request(&request);
+    if (FAILED(hr) || !request)
+        goto exit;
+
+    hr = request->mainDocumentURL(&frameURL);
+    if (FAILED(hr))
+        goto exit;
+
+    SendMessage(hURLBarWnd, (UINT)WM_SETTEXT, 0, (LPARAM)frameURL);
+
+exit:
+    if (mainFrame)
+        mainFrame->Release();
+    if (dataSource)
+        dataSource->Release();
+    if (request)
+        request->Release();
+    SysFreeString(frameURL);
+    return 0;
+}
+
+HRESULT STDMETHODCALLTYPE SpinneretWebHost::QueryInterface(REFIID riid, void** ppvObject)
 {
-    SendMessageA(hURLBarWnd, (UINT)WM_SETTEXT, 0, (LPARAM)URL);
+    *ppvObject = 0;
+    if (IsEqualGUID(riid, IID_IUnknown))
+        *ppvObject = static_cast<IWebFrameLoadDelegate*>(this);
+    else if (IsEqualGUID(riid, IID_IWebFrameLoadDelegate))
+        *ppvObject = static_cast<IWebFrameLoadDelegate*>(this);
+    else
+        return E_NOINTERFACE;
+
+    AddRef();
+    return S_OK;
 }
 
-void SpinneretWebHost::loadEnd(BOOL successful, DWORD error, LPCTSTR errorString)
+ULONG STDMETHODCALLTYPE SpinneretWebHost::AddRef(void)
 {
+    return ++m_refCount;
+}
+
+ULONG STDMETHODCALLTYPE SpinneretWebHost::Release(void)
+{
+    ULONG newRef = --m_refCount;
+    if (!newRef)
+        delete(this);
+
+    return newRef;
 }
 
 static void resizeSubViews()
@@ -67,7 +130,7 @@ static void resizeSubViews()
     RECT rcClient;
     GetClientRect(hMainWnd, &rcClient);
     MoveWindow(hURLBarWnd, 0, 0, rcClient.right, URLBAR_HEIGHT, TRUE);
-    MoveWindow(gWebView->windowHandle(), 0, URLBAR_HEIGHT, rcClient.right, rcClient.bottom - URLBAR_HEIGHT, TRUE);
+    MoveWindow(gViewWindow, 0, URLBAR_HEIGHT, rcClient.right, rcClient.bottom - URLBAR_HEIGHT, TRUE);
 }
 
 int APIENTRY _tWinMain(HINSTANCE hInstance,
@@ -116,26 +179,61 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
     SetWindowLong(hURLBarWnd, GWL_WNDPROC,(long)MyEditProc);
     SetFocus(hURLBarWnd);
 
+    HRESULT hr = CoCreateInstance(CLSID_WebView, 0, CLSCTX_ALL, IID_IWebView, (void**)&gWebView);
+    if (FAILED(hr))
+        goto exit;
+
     gWebHost = new SpinneretWebHost();
-    gWebView = WebView::createWebView(hInstance, hMainWnd, gWebHost);
-    gWebView->mainFrame()->loadHTMLString("<p style=\"background-color: #00FF00\">Testing</p><img src=\"http://webkit.opendarwin.org/images/icon-gold.png\" alt=\"Face\"><div style=\"border: solid blue\" contenteditable=\"true\">div with blue border</div><ul><li>foo<li>bar<li>baz</ul>");
+    gWebHost->AddRef();
+    hr = gWebView->setFrameLoadDelegate(gWebHost);
+    if (FAILED(hr))
+        goto exit;
+
+    hr = gWebView->setHostWindow(hMainWnd);
+    if (FAILED(hr))
+        goto exit;
+
+    RECT clientRect;
+    GetClientRect(hMainWnd, &clientRect);
+    hr = gWebView->initWithFrame(&clientRect, 0, 0);
+    if (FAILED(hr))
+        goto exit;
+
+    IWebFrame* frame;
+    hr = gWebView->mainFrame(&frame);
+    if (FAILED(hr))
+        goto exit;
+    static BSTR defaultHTML = 0;
+    if (!defaultHTML)
+        defaultHTML = SysAllocString(TEXT("<p style=\"background-color: #00FF00\">Testing</p><img src=\"http://webkit.opendarwin.org/images/icon-gold.png\" alt=\"Face\"><div style=\"border: solid blue\" contenteditable=\"true\">div with blue border</div><ul><li>foo<li>bar<li>baz</ul>"));
+    frame->loadHTMLString(defaultHTML, 0);
+    frame->Release();
+
+    IWebViewExt* viewExt;
+    hr = gWebView->QueryInterface(IID_IWebViewExt, (void**)&viewExt);
+    if (FAILED(hr))
+        goto exit;
+    hr = viewExt->viewWindow(&gViewWindow);
+    viewExt->Release();
+    if (FAILED(hr) || !gViewWindow)
+        goto exit;
 
     resizeSubViews();
-    ShowWindow(gWebView->windowHandle(), nCmdShow);
-    UpdateWindow(gWebView->windowHandle());
+
+    ShowWindow(gViewWindow, nCmdShow);
+    UpdateWindow(gViewWindow);
 
     hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_SPINNERET));
 
     // Main message loop:
-    while (GetMessage(&msg, NULL, 0, 0))
-    {
-        if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
-        {
+    while (GetMessage(&msg, NULL, 0, 0)) {
+        if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) {
             TranslateMessage(&msg);
             DispatchMessage(&msg);
         }
     }
 
+exit:
     delete gWebView;
 #ifdef _CRTDBG_MAP_ALLOC
     _CrtDumpMemoryLeaks();
@@ -190,22 +288,20 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
     PAINTSTRUCT ps;
     HDC hdc;
 
-    switch (message)
-    {
+    switch (message) {
     case WM_COMMAND:
         wmId    = LOWORD(wParam);
         wmEvent = HIWORD(wParam);
         // Parse the menu selections:
-        switch (wmId)
-        {
-        case IDM_ABOUT:
-            DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
-            break;
-        case IDM_EXIT:
-            DestroyWindow(hWnd);
-            break;
-        default:
-            return DefWindowProc(hWnd, message, wParam, lParam);
+        switch (wmId) {
+            case IDM_ABOUT:
+                DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
+                break;
+            case IDM_EXIT:
+                DestroyWindow(hWnd);
+                break;
+            default:
+                return DefWindowProc(hWnd, message, wParam, lParam);
         }
         break;
     case WM_DESTROY:
@@ -231,17 +327,12 @@ LRESULT CALLBACK MyEditProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPara
         case WM_CHAR:
             if( wParam == 13 ) { // Enter Key
                 wchar_t strPtr[MAX_URL_LENGTH];
-                char    cstrPtr[MAX_URL_LENGTH];
                 *((LPWORD)strPtr) = MAX_URL_LENGTH; 
                 int strLen = SendMessage(hDlg, EM_GETLINE, 0, (LPARAM)strPtr);
 
-                int x;
-                for(x = 0; x < strLen; x++)
-                    cstrPtr[x] = strPtr[x];
-                cstrPtr[x] = 0;
-
-                gWebView->mainFrame()->loadURL(cstrPtr);
-                SetFocus(gWebView->windowHandle());
+                BSTR bstr = SysAllocStringLen(strPtr, strLen);
+                loadURL(bstr);
+                SysFreeString(bstr);
 
                 return 0;
             } else
@@ -259,14 +350,12 @@ LRESULT CALLBACK MyEditProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPara
 INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 {
     UNREFERENCED_PARAMETER(lParam);
-    switch (message)
-    {
+    switch (message) {
     case WM_INITDIALOG:
         return (INT_PTR)TRUE;
 
     case WM_COMMAND:
-        if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
-        {
+        if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) {
             EndDialog(hDlg, LOWORD(wParam));
             return (INT_PTR)TRUE;
         }
@@ -274,3 +363,48 @@ INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     }
     return (INT_PTR)FALSE;
 }
+
+static void loadURL(BSTR urlBStr)
+{
+    IWebFrame* frame = 0;
+    IWebMutableURLRequest* request = 0;
+    static BSTR methodBStr = 0;
+
+    if (!methodBStr)
+        methodBStr = SysAllocString(TEXT("GET"));
+
+    if (urlBStr && urlBStr[0] && (PathFileExists(urlBStr) || PathIsUNC(urlBStr))) {
+        TCHAR fileURL[INTERNET_MAX_URL_LENGTH];
+        DWORD fileURLLength = sizeof(fileURL)/sizeof(fileURL[0]);
+        if (SUCCEEDED(UrlCreateFromPath(urlBStr, fileURL, &fileURLLength, 0)))
+            urlBStr = fileURL;
+    }
+
+    HRESULT hr = gWebView->mainFrame(&frame);
+    if (FAILED(hr))
+        goto exit;
+
+    hr = CoCreateInstance(CLSID_WebMutableURLRequest, 0, CLSCTX_ALL, IID_IWebMutableURLRequest, (void**)&request);
+    if (FAILED(hr))
+        goto exit;
+
+    hr = request->initWithURL(urlBStr, WebURLRequestUseProtocolCachePolicy, 0);
+    if (FAILED(hr))
+        goto exit;
+
+    hr = request->setHTTPMethod(methodBStr);
+    if (FAILED(hr))
+        goto exit;
+
+    hr = frame->loadRequest(request);
+    if (FAILED(hr))
+        goto exit;
+
+    SetFocus(gViewWindow);
+
+exit:
+    if (frame)
+        frame->Release();
+    if (request)
+        request->Release();
+}
index 73cf41c..f47a7a7 100755 (executable)
 #pragma once
 
 #include "resource.h"
-#include "WebHost.h"
+#include "IWebURLResponse.h"
+#include "IWebFrameLoadDelegate.h"
 
-using namespace WebKit;
-
-class SpinneretWebHost : public WebHost
+class SpinneretWebHost : public IWebFrameLoadDelegate
 {
 public:
-    virtual void updateLocationBar(const char* URL);
-    virtual void loadEnd(BOOL successful, DWORD error, LPCTSTR errorString);
-};
+    // IUnknown
+    virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
+    virtual ULONG STDMETHODCALLTYPE AddRef(void);
+    virtual ULONG STDMETHODCALLTYPE Release(void);
+
+    // IWebFrameLoadDelegate
+    virtual HRESULT STDMETHODCALLTYPE didStartProvisionalLoadForFrame( 
+        /* [in] */ IWebView* webView,
+        /* [in] */ IWebFrame* /*frame*/) { return updateAddressBar(webView); }
+    
+    virtual HRESULT STDMETHODCALLTYPE didReceiveServerRedirectForProvisionalLoadForFrame( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ IWebFrame *frame) { return S_OK; }
+    
+    virtual HRESULT STDMETHODCALLTYPE didFailProvisionalLoadWithError( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ IWebError *error,
+        /* [in] */ IWebFrame *frame) { return S_OK; }
+    
+    virtual HRESULT STDMETHODCALLTYPE didCommitLoadForFrame( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ IWebFrame *frame) { return S_OK; }
+    
+    virtual HRESULT STDMETHODCALLTYPE didReceiveTitle( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ BSTR title,
+        /* [in] */ IWebFrame *frame) { return S_OK; }
+    
+    virtual HRESULT STDMETHODCALLTYPE didReceiveIcon( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ IWebImage *image,
+        /* [in] */ IWebFrame *frame) { return S_OK; }
+    
+    virtual HRESULT STDMETHODCALLTYPE didFinishLoadForFrame( 
+        /* [in] */ IWebView* webView,
+        /* [in] */ IWebFrame* /*frame*/) { return updateAddressBar(webView); }
+    
+    virtual HRESULT STDMETHODCALLTYPE didFailLoadWithError( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ IWebError *error,
+        /* [in] */ IWebFrame *forFrame) { return S_OK; }
+    
+    virtual HRESULT STDMETHODCALLTYPE didChangeLocationWithinPageForFrame( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ IWebFrame *frame) { return S_OK; }
+    
+    virtual HRESULT STDMETHODCALLTYPE willPerformClientRedirectToURL( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ BSTR url,
+        UINT delaySeconds,
+        /* [in] */ UINT fireDate,
+        /* [in] */ IWebFrame *frame) { return S_OK; }
+    
+    virtual HRESULT STDMETHODCALLTYPE didCancelClientRedirectForFrame( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ IWebFrame *frame) { return S_OK; }
+    
+    virtual HRESULT STDMETHODCALLTYPE willCloseFrame( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ IWebFrame *frame) { return S_OK; }
+    
+    virtual HRESULT STDMETHODCALLTYPE windowScriptObjectAvailable( 
+        /* [in] */ IWebView *webView,
+        /* [in] */ IWebScriptObject *windowScriptObject) { return S_OK; }
+
+    // SpinneretWebHost
+
+protected:
+    HRESULT updateAddressBar(IWebView* webView);
+
+protected:
+    ULONG                   m_refCount;
+};
\ No newline at end of file
index eae72c0..1fc2db8 100755 (executable)
@@ -40,7 +40,7 @@
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
-                               AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\..\WebKitWin\public&quot;"\r
+                               AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\$(ConfigurationName)\WebKitWin&quot;;&quot;$(WebKitOutputDir)\$(ConfigurationName)\WTF&quot;"\r
                                PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"\r
                                MinimalRebuild="true"\r
                                ExceptionHandling="0"\r
@@ -63,6 +63,7 @@
                        />\r
                        <Tool\r
                                Name="VCLinkerTool"\r
+                               AdditionalDependencies="comctl32.lib shlwapi.lib"\r
                                LinkIncremental="2"\r
                                AdditionalLibraryDirectories=""\r
                                GenerateDebugInformation="true"\r
                        />\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
-                               AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\..\WebKitWin\public&quot;"\r
+                               AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\$(ConfigurationName)\WebKitWin&quot;;&quot;$(WebKitOutputDir)\$(ConfigurationName)\WTF&quot;"\r
                                PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"\r
                                ExceptionHandling="0"\r
                                RuntimeLibrary="2"\r
                        <Tool\r
                                Name="VCLinkerTool"\r
                                AdditionalOptions="&quot;$(ProjectDir)\..\..\..\iconv\lib\iconv.lib&quot;&#x0D;&#x0A;&quot;$(ProjectDir)\..\..\..\libxml\lib\libxml2.lib&quot;&#x0D;&#x0A;&quot;$(ProjectDir)\..\..\..\libxslt\lib\libxslt.lib&quot;&#x0D;&#x0A;&quot;$(ProjectDir)\..\..\..\icu\lib\icuuc.lib&quot;&#x0D;&#x0A;"\r
+                               AdditionalDependencies="comctl32.lib shlwapi.lib"\r
                                LinkIncremental="1"\r
                                AdditionalLibraryDirectories="&quot;$(ProjectDir)\..\..\..\&quot;"\r
                                GenerateDebugInformation="true"\r