X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/153530afb595110592776c461e52be99b1559439..b404a8f3b072129c107c6d9a5e0f6f53cd34807b:/src/msw/webview_ie.cpp diff --git a/src/msw/webview_ie.cpp b/src/msw/webview_ie.cpp index 07cda9f9d5..868877c9ef 100644 --- a/src/msw/webview_ie.cpp +++ b/src/msw/webview_ie.cpp @@ -27,6 +27,8 @@ #include "wx/msw/missing.h" #include "wx/filesys.h" +wxIMPLEMENT_DYNAMIC_CLASS(wxWebViewIE, wxWebView); + //We link to urlmon as it is required for CoInternetGetSession #pragma comment(lib, "urlmon") @@ -663,7 +665,7 @@ void wxWebViewIE::RunScript(const wxString& javascript) document->Release(); } -void wxWebViewIE::RegisterProtocol(wxWebProtocolHandler* handler) +void wxWebViewIE::RegisterHandler(wxSharedPtr handler) { ClassFactory* cf = new ClassFactory(handler); IInternetSession* session; @@ -672,7 +674,7 @@ void wxWebViewIE::RegisterProtocol(wxWebProtocolHandler* handler) wxFAIL_MSG("Could not retrive internet session"); } - HRESULT hr = session->RegisterNameSpace(cf, CLSID_FileProtocol, handler->GetProtocol(), 0, NULL, 0); + HRESULT hr = session->RegisterNameSpace(cf, CLSID_FileProtocol, handler->GetName(), 0, NULL, 0); if(FAILED(hr)) { wxFAIL_MSG("Could not register protocol"); @@ -957,7 +959,7 @@ void wxWebViewIE::onActiveXEvent(wxActiveXEvent& evt) evt.Skip(); } -VirtualProtocol::VirtualProtocol(wxWebProtocolHandler *handler) +VirtualProtocol::VirtualProtocol(wxSharedPtr handler) { m_refCount = 0; m_file = NULL; @@ -983,12 +985,6 @@ HRESULT VirtualProtocol::QueryInterface(REFIID riid, void **ppvObject) AddRef(); return S_OK; } - else if(riid == IID_IInternetProtocolInfo) - { - *ppvObject = (IInternetProtocolInfo*)this; - AddRef(); - return S_OK; - } else { *ppvObject = NULL; @@ -1076,40 +1072,6 @@ HRESULT VirtualProtocol::Read(void *pv, ULONG cb, ULONG *pcbRead) } } -HRESULT VirtualProtocol::CombineUrl(LPCWSTR pwzBaseUrl, LPCWSTR pwzRelativeUrl, - DWORD dwCombineFlags, LPWSTR pwzResult, - DWORD cchResult, DWORD *pcchResult, - DWORD dwReserved) -{ - wxString newuri = m_handler->CombineURIs(pwzBaseUrl, pwzRelativeUrl); - //Check the buffer we are given can hold the new urll - if(wxStrlen(newuri) > cchResult) - return S_FALSE; - - wxStrcpy(pwzResult, newuri.c_str()); - *pcchResult = wxStrlen(newuri); - return S_OK; -} - -HRESULT VirtualProtocol::ParseUrl(LPCWSTR pwzUrl, PARSEACTION ParseAction, - DWORD dwParseFlags, LPWSTR pwzResult, - DWORD cchResult, DWORD *pcchResult, - DWORD dwReserved) -{ - //return INET_E_DEFAULT_ACTION; - wxStrcpy(pwzResult, pwzUrl); - *pcchResult = wxStrlen(pwzResult); - return S_OK; -} - -HRESULT VirtualProtocol::QueryInfo(LPCWSTR pwzUrl, QUERYOPTION OueryOption, - DWORD dwQueryFlags, LPVOID pBuffer, - DWORD cbBuffer, DWORD *pcbBuf, - DWORD dwReserved) -{ - return INET_E_DEFAULT_ACTION; -} - HRESULT ClassFactory::CreateInstance(IUnknown* pUnkOuter, REFIID riid, void ** ppvObject) {