Commit c1acf164 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

ieframe: Added partial Refresh2 implementation.

parent dae9096c
...@@ -532,12 +532,15 @@ void deactivate_document(DocHost *This) ...@@ -532,12 +532,15 @@ void deactivate_document(DocHost *This)
This->document = NULL; This->document = NULL;
} }
HRESULT refresh_document(DocHost *This) HRESULT refresh_document(DocHost *This, const VARIANT *level)
{ {
IOleCommandTarget *cmdtrg; IOleCommandTarget *cmdtrg;
VARIANT vin, vout; VARIANT vin, vout;
HRESULT hres; 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) { if(!This->document) {
FIXME("no document\n"); FIXME("no document\n");
return E_FAIL; return E_FAIL;
......
...@@ -182,14 +182,16 @@ static HRESULT WINAPI InternetExplorer_Refresh(IWebBrowser2 *iface) ...@@ -182,14 +182,16 @@ static HRESULT WINAPI InternetExplorer_Refresh(IWebBrowser2 *iface)
TRACE("(%p)\n", This); 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) static HRESULT WINAPI InternetExplorer_Refresh2(IWebBrowser2 *iface, VARIANT *Level)
{ {
InternetExplorer *This = impl_from_IWebBrowser2(iface); 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) static HRESULT WINAPI InternetExplorer_Stop(IWebBrowser2 *iface)
......
...@@ -265,7 +265,7 @@ HRESULT navigate_url(DocHost*,LPCWSTR,const VARIANT*,const VARIANT*,VARIANT*,VAR ...@@ -265,7 +265,7 @@ HRESULT navigate_url(DocHost*,LPCWSTR,const VARIANT*,const VARIANT*,VARIANT*,VAR
HRESULT go_home(DocHost*) DECLSPEC_HIDDEN; HRESULT go_home(DocHost*) DECLSPEC_HIDDEN;
HRESULT go_back(DocHost*) DECLSPEC_HIDDEN; HRESULT go_back(DocHost*) DECLSPEC_HIDDEN;
HRESULT go_forward(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 get_location_url(DocHost*,BSTR*) DECLSPEC_HIDDEN;
HRESULT set_dochost_url(DocHost*,const WCHAR*) DECLSPEC_HIDDEN; HRESULT set_dochost_url(DocHost*,const WCHAR*) DECLSPEC_HIDDEN;
void handle_navigation_error(DocHost*,HRESULT,BSTR,IHTMLWindow2*) DECLSPEC_HIDDEN; void handle_navigation_error(DocHost*,HRESULT,BSTR,IHTMLWindow2*) DECLSPEC_HIDDEN;
......
...@@ -2835,15 +2835,27 @@ static void test_download(DWORD flags) ...@@ -2835,15 +2835,27 @@ static void test_download(DWORD flags)
CLEAR_CALLED(QueryStatus_STOP); CLEAR_CALLED(QueryStatus_STOP);
} }
static void test_Refresh(IWebBrowser2 *webbrowser) static void test_Refresh(IWebBrowser2 *webbrowser, BOOL use_refresh2)
{ {
HRESULT hres; HRESULT hres;
trace("Refresh...\n"); trace("Refresh...\n");
SET_EXPECT(Exec_DocHostCommandHandler_2300); 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); CHECK_CALLED(Exec_DocHostCommandHandler_2300);
test_download(DWL_REFRESH); test_download(DWL_REFRESH);
...@@ -3423,7 +3435,8 @@ static void test_WebBrowser(BOOL do_download, BOOL do_close) ...@@ -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_Navigate2(webbrowser, "http://test.winehq.org/tests/hello.html");
test_download(DWL_EXPECT_BEFORE_NAVIGATE|DWL_HTTP); 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"); trace("put_href http URL...\n");
test_put_href(webbrowser, "http://test.winehq.org/tests/winehq_snapshot/"); test_put_href(webbrowser, "http://test.winehq.org/tests/winehq_snapshot/");
......
...@@ -296,14 +296,16 @@ static HRESULT WINAPI WebBrowser_Refresh(IWebBrowser2 *iface) ...@@ -296,14 +296,16 @@ static HRESULT WINAPI WebBrowser_Refresh(IWebBrowser2 *iface)
TRACE("(%p)\n", This); 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) static HRESULT WINAPI WebBrowser_Refresh2(IWebBrowser2 *iface, VARIANT *Level)
{ {
WebBrowser *This = impl_from_IWebBrowser2(iface); 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) static HRESULT WINAPI WebBrowser_Stop(IWebBrowser2 *iface)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment