Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
a03da229
Commit
a03da229
authored
Dec 04, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 05, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Make translate_url IUri-based.
parent
9a1000c8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
52 deletions
+56
-52
nsio.c
dlls/mshtml/nsio.c
+56
-52
No files found.
dlls/mshtml/nsio.c
View file @
a03da229
...
@@ -192,58 +192,6 @@ HRESULT load_nsuri(HTMLWindow *window, nsWineURI *uri, nsChannelBSC *channelbsc,
...
@@ -192,58 +192,6 @@ HRESULT load_nsuri(HTMLWindow *window, nsWineURI *uri, nsChannelBSC *channelbsc,
return
S_OK
;
return
S_OK
;
}
}
static
BOOL
translate_url
(
HTMLDocumentObj
*
doc
,
nsWineURI
*
uri
)
{
OLECHAR
*
new_url
=
NULL
,
*
url
;
BOOL
ret
=
FALSE
;
HRESULT
hres
;
if
(
!
doc
->
hostui
)
return
FALSE
;
url
=
heap_strdupW
(
uri
->
wine_url
);
hres
=
IDocHostUIHandler_TranslateUrl
(
doc
->
hostui
,
0
,
url
,
&
new_url
);
if
(
hres
==
S_OK
&&
new_url
)
{
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
);
}
heap_free
(
url
);
return
ret
;
}
nsresult
on_start_uri_open
(
NSContainer
*
nscontainer
,
nsIURI
*
uri
,
PRBool
*
_retval
)
{
nsWineURI
*
wine_uri
;
nsresult
nsres
;
*
_retval
=
FALSE
;
nsres
=
nsIURI_QueryInterface
(
uri
,
&
IID_nsWineURI
,
(
void
**
)
&
wine_uri
);
if
(
NS_FAILED
(
nsres
))
{
WARN
(
"Could not get nsWineURI: %08x
\n
"
,
nsres
);
return
NS_ERROR_NOT_IMPLEMENTED
;
}
if
(
!
wine_uri
->
is_doc_uri
)
{
wine_uri
->
is_doc_uri
=
TRUE
;
if
(
!
wine_uri
->
container
)
{
nsIWebBrowserChrome_AddRef
(
NSWBCHROME
(
nscontainer
));
wine_uri
->
container
=
nscontainer
;
}
if
(
nscontainer
->
doc
)
*
_retval
=
translate_url
(
nscontainer
->
doc
,
wine_uri
);
}
nsIURI_Release
(
NSURI
(
wine_uri
));
return
NS_OK
;
}
HRESULT
set_wine_url
(
nsWineURI
*
This
,
LPCWSTR
url
)
HRESULT
set_wine_url
(
nsWineURI
*
This
,
LPCWSTR
url
)
{
{
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
url
));
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
url
));
...
@@ -3107,6 +3055,62 @@ static const nsIFactoryVtbl nsIOServiceFactoryVtbl = {
...
@@ -3107,6 +3055,62 @@ static const nsIFactoryVtbl nsIOServiceFactoryVtbl = {
static
nsIFactory
nsIOServiceFactory
=
{
&
nsIOServiceFactoryVtbl
};
static
nsIFactory
nsIOServiceFactory
=
{
&
nsIOServiceFactoryVtbl
};
static
BOOL
translate_url
(
HTMLDocumentObj
*
doc
,
nsWineURI
*
uri
)
{
OLECHAR
*
new_url
=
NULL
;
WCHAR
*
url
;
BOOL
ret
=
FALSE
;
HRESULT
hres
;
if
(
!
doc
->
hostui
||
!
ensure_uri
(
uri
))
return
FALSE
;
hres
=
IUri_GetDisplayUri
(
uri
->
uri
,
&
url
);
if
(
FAILED
(
hres
))
return
FALSE
;
hres
=
IDocHostUIHandler_TranslateUrl
(
doc
->
hostui
,
0
,
url
,
&
new_url
);
if
(
hres
==
S_OK
&&
new_url
)
{
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
);
}
SysFreeString
(
url
);
return
ret
;
}
nsresult
on_start_uri_open
(
NSContainer
*
nscontainer
,
nsIURI
*
uri
,
PRBool
*
_retval
)
{
nsWineURI
*
wine_uri
;
nsresult
nsres
;
*
_retval
=
FALSE
;
nsres
=
nsIURI_QueryInterface
(
uri
,
&
IID_nsWineURI
,
(
void
**
)
&
wine_uri
);
if
(
NS_FAILED
(
nsres
))
{
WARN
(
"Could not get nsWineURI: %08x
\n
"
,
nsres
);
return
NS_ERROR_NOT_IMPLEMENTED
;
}
if
(
!
wine_uri
->
is_doc_uri
)
{
wine_uri
->
is_doc_uri
=
TRUE
;
if
(
!
wine_uri
->
container
)
{
nsIWebBrowserChrome_AddRef
(
NSWBCHROME
(
nscontainer
));
wine_uri
->
container
=
nscontainer
;
}
if
(
nscontainer
->
doc
)
*
_retval
=
translate_url
(
nscontainer
->
doc
,
wine_uri
);
}
nsIURI_Release
(
NSURI
(
wine_uri
));
return
NS_OK
;
}
void
init_nsio
(
nsIComponentManager
*
component_manager
,
nsIComponentRegistrar
*
registrar
)
void
init_nsio
(
nsIComponentManager
*
component_manager
,
nsIComponentRegistrar
*
registrar
)
{
{
nsIFactory
*
old_factory
=
NULL
;
nsIFactory
*
old_factory
=
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment