mshtml: Call IDocHostUIHandler::TranslateUrl from OnURIOpen.
This commit is contained in:
parent
520f41b259
commit
7a2e3a7b02
|
@ -1179,6 +1179,33 @@ static nsrefcnt NSAPI nsURIContentListener_Release(nsIURIContentListener *iface)
|
||||||
return nsIWebBrowserChrome_Release(NSWBCHROME(This));
|
return nsIWebBrowserChrome_Release(NSWBCHROME(This));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BOOL translate_url(HTMLDocument *doc, nsIWineURI *nsuri)
|
||||||
|
{
|
||||||
|
OLECHAR *new_url = NULL, *url;
|
||||||
|
BOOL ret = FALSE;
|
||||||
|
LPCWSTR wine_url;
|
||||||
|
HRESULT hres;
|
||||||
|
|
||||||
|
if(!doc->hostui)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
nsIWineURI_GetWineURL(nsuri, &wine_url);
|
||||||
|
|
||||||
|
url = heap_strdupW(wine_url);
|
||||||
|
hres = IDocHostUIHandler_TranslateUrl(doc->hostui, 0, url, &new_url);
|
||||||
|
heap_free(url);
|
||||||
|
if(hres != S_OK || !new_url)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if(strcmpW(url, new_url)) {
|
||||||
|
FIXME("TranslateUrl returned new URL %s -> %s\n", debugstr_w(url), debugstr_w(new_url));
|
||||||
|
ret = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
CoTaskMemFree(new_url);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static nsresult NSAPI nsURIContentListener_OnStartURIOpen(nsIURIContentListener *iface,
|
static nsresult NSAPI nsURIContentListener_OnStartURIOpen(nsIURIContentListener *iface,
|
||||||
nsIURI *aURI, PRBool *_retval)
|
nsIURI *aURI, PRBool *_retval)
|
||||||
{
|
{
|
||||||
|
@ -1222,12 +1249,15 @@ static nsresult NSAPI nsURIContentListener_OnStartURIOpen(nsIURIContentListener
|
||||||
|
|
||||||
IMoniker_Release(mon);
|
IMoniker_Release(mon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*_retval = FALSE;
|
||||||
|
}else if(This->doc) {
|
||||||
|
*_retval = translate_url(This->doc, wine_uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIWineURI_Release(wine_uri);
|
nsIWineURI_Release(wine_uri);
|
||||||
|
|
||||||
*_retval = FALSE;
|
return !*_retval && This->content_listener
|
||||||
return This->content_listener
|
|
||||||
? nsIURIContentListener_OnStartURIOpen(This->content_listener, aURI, _retval)
|
? nsIURIContentListener_OnStartURIOpen(This->content_listener, aURI, _retval)
|
||||||
: NS_OK;
|
: NS_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue