Jacek Caban : ieframe: Added partial Refresh2 implementation.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Sep 25 14:15:16 CDT 2014
Module: wine
Branch: master
Commit: c1acf1647b505460baa5cb3891926358f0677cd0
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c1acf1647b505460baa5cb3891926358f0677cd0
Author: Jacek Caban <jacek at codeweavers.com>
Date: Thu Sep 25 13:38:24 2014 +0200
ieframe: Added partial Refresh2 implementation.
---
dlls/ieframe/dochost.c | 5 ++++-
dlls/ieframe/ie.c | 8 +++++---
dlls/ieframe/ieframe.h | 2 +-
dlls/ieframe/tests/webbrowser.c | 21 +++++++++++++++++----
dlls/ieframe/webbrowser.c | 8 +++++---
5 files changed, 32 insertions(+), 12 deletions(-)
diff --git a/dlls/ieframe/dochost.c b/dlls/ieframe/dochost.c
index 8c5d4b5..c76e91c 100644
--- a/dlls/ieframe/dochost.c
+++ b/dlls/ieframe/dochost.c
@@ -532,12 +532,15 @@ void deactivate_document(DocHost *This)
This->document = NULL;
}
-HRESULT refresh_document(DocHost *This)
+HRESULT refresh_document(DocHost *This, const VARIANT *level)
{
IOleCommandTarget *cmdtrg;
VARIANT vin, vout;
HRESULT hres;
+ if(level && (V_VT(level) != VT_I4 || V_I4(level) != REFRESH_NORMAL))
+ FIXME("Unsupported refresh level %s\n", debugstr_variant(level));
+
if(!This->document) {
FIXME("no document\n");
return E_FAIL;
diff --git a/dlls/ieframe/ie.c b/dlls/ieframe/ie.c
index 5eb1d26..12be68e 100644
--- a/dlls/ieframe/ie.c
+++ b/dlls/ieframe/ie.c
@@ -182,14 +182,16 @@ static HRESULT WINAPI InternetExplorer_Refresh(IWebBrowser2 *iface)
TRACE("(%p)\n", This);
- return refresh_document(&This->doc_host);
+ return refresh_document(&This->doc_host, NULL);
}
static HRESULT WINAPI InternetExplorer_Refresh2(IWebBrowser2 *iface, VARIANT *Level)
{
InternetExplorer *This = impl_from_IWebBrowser2(iface);
- FIXME("(%p)->(%p)\n", This, Level);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, Level);
+
+ return refresh_document(&This->doc_host, Level);
}
static HRESULT WINAPI InternetExplorer_Stop(IWebBrowser2 *iface)
diff --git a/dlls/ieframe/ieframe.h b/dlls/ieframe/ieframe.h
index 063832d..93be1fe 100644
--- a/dlls/ieframe/ieframe.h
+++ b/dlls/ieframe/ieframe.h
@@ -265,7 +265,7 @@ HRESULT navigate_url(DocHost*,LPCWSTR,const VARIANT*,const VARIANT*,VARIANT*,VAR
HRESULT go_home(DocHost*) DECLSPEC_HIDDEN;
HRESULT go_back(DocHost*) DECLSPEC_HIDDEN;
HRESULT go_forward(DocHost*) DECLSPEC_HIDDEN;
-HRESULT refresh_document(DocHost*) DECLSPEC_HIDDEN;
+HRESULT refresh_document(DocHost*,const VARIANT*) DECLSPEC_HIDDEN;
HRESULT get_location_url(DocHost*,BSTR*) DECLSPEC_HIDDEN;
HRESULT set_dochost_url(DocHost*,const WCHAR*) DECLSPEC_HIDDEN;
void handle_navigation_error(DocHost*,HRESULT,BSTR,IHTMLWindow2*) DECLSPEC_HIDDEN;
diff --git a/dlls/ieframe/tests/webbrowser.c b/dlls/ieframe/tests/webbrowser.c
index 12b349f..0ddd360 100644
--- a/dlls/ieframe/tests/webbrowser.c
+++ b/dlls/ieframe/tests/webbrowser.c
@@ -2835,15 +2835,27 @@ static void test_download(DWORD flags)
CLEAR_CALLED(QueryStatus_STOP);
}
-static void test_Refresh(IWebBrowser2 *webbrowser)
+static void test_Refresh(IWebBrowser2 *webbrowser, BOOL use_refresh2)
{
HRESULT hres;
trace("Refresh...\n");
SET_EXPECT(Exec_DocHostCommandHandler_2300);
- hres = IWebBrowser2_Refresh(webbrowser);
- ok(hres == S_OK, "Refresh failed: %08x\n", hres);
+
+ if(use_refresh2) {
+ VARIANT v;
+
+ V_VT(&v) = VT_I4;
+ V_I4(&v) = REFRESH_NORMAL;
+
+ hres = IWebBrowser2_Refresh2(webbrowser, &v);
+ ok(hres == S_OK, "Refresh failed: %08x\n", hres);
+ }else {
+ hres = IWebBrowser2_Refresh(webbrowser);
+ ok(hres == S_OK, "Refresh failed: %08x\n", hres);
+ }
+
CHECK_CALLED(Exec_DocHostCommandHandler_2300);
test_download(DWL_REFRESH);
@@ -3423,7 +3435,8 @@ static void test_WebBrowser(BOOL do_download, BOOL do_close)
test_Navigate2(webbrowser, "http://test.winehq.org/tests/hello.html");
test_download(DWL_EXPECT_BEFORE_NAVIGATE|DWL_HTTP);
- test_Refresh(webbrowser);
+ test_Refresh(webbrowser, FALSE);
+ test_Refresh(webbrowser, TRUE);
trace("put_href http URL...\n");
test_put_href(webbrowser, "http://test.winehq.org/tests/winehq_snapshot/");
diff --git a/dlls/ieframe/webbrowser.c b/dlls/ieframe/webbrowser.c
index 55f757f..a3233e1 100644
--- a/dlls/ieframe/webbrowser.c
+++ b/dlls/ieframe/webbrowser.c
@@ -296,14 +296,16 @@ static HRESULT WINAPI WebBrowser_Refresh(IWebBrowser2 *iface)
TRACE("(%p)\n", This);
- return refresh_document(&This->doc_host);
+ return refresh_document(&This->doc_host, NULL);
}
static HRESULT WINAPI WebBrowser_Refresh2(IWebBrowser2 *iface, VARIANT *Level)
{
WebBrowser *This = impl_from_IWebBrowser2(iface);
- FIXME("(%p)->(%s)\n", This, debugstr_variant(Level));
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_variant(Level));
+
+ return refresh_document(&This->doc_host, Level);
}
static HRESULT WINAPI WebBrowser_Stop(IWebBrowser2 *iface)
More information about the wine-cvs
mailing list