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
0f5badf4
Commit
0f5badf4
authored
Apr 02, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 02, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ieframe: Use IPersistHistory for history navigation, if possible.
parent
f1517b15
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
14 deletions
+60
-14
dochost.c
dlls/ieframe/dochost.c
+28
-0
ieframe.h
dlls/ieframe/ieframe.h
+1
-0
navigate.c
dlls/ieframe/navigate.c
+31
-14
No files found.
dlls/ieframe/dochost.c
View file @
0f5badf4
...
...
@@ -20,6 +20,7 @@
#include "exdispid.h"
#include "mshtml.h"
#include "perhist.h"
#include "initguid.h"
#include "wine/debug.h"
...
...
@@ -335,9 +336,33 @@ static LRESULT WINAPI doc_view_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
static
void
free_travellog_entry
(
travellog_entry_t
*
entry
)
{
if
(
entry
->
stream
)
IStream_Release
(
entry
->
stream
);
heap_free
(
entry
->
url
);
}
static
IStream
*
get_travellog_stream
(
DocHost
*
This
)
{
IPersistHistory
*
persist_history
;
IStream
*
stream
;
HRESULT
hres
;
hres
=
IUnknown_QueryInterface
(
This
->
document
,
&
IID_IPersistHistory
,
(
void
**
)
&
persist_history
);
if
(
FAILED
(
hres
))
return
NULL
;
hres
=
CreateStreamOnHGlobal
(
NULL
,
TRUE
,
&
stream
);
if
(
SUCCEEDED
(
hres
))
hres
=
IPersistHistory_SaveHistory
(
persist_history
,
stream
);
IPersistHistory_Release
(
persist_history
);
if
(
FAILED
(
hres
))
{
IStream_Release
(
stream
);
return
NULL
;
}
return
stream
;
}
static
void
update_travellog
(
DocHost
*
This
)
{
travellog_entry_t
*
new_entry
;
...
...
@@ -368,9 +393,12 @@ static void update_travellog(DocHost *This)
new_entry
=
This
->
travellog
.
log
+
This
->
travellog
.
position
;
new_entry
->
url
=
heap_strdupW
(
This
->
url
);
TRACE
(
"Adding %s at %d
\n
"
,
debugstr_w
(
This
->
url
),
This
->
travellog
.
position
);
if
(
!
new_entry
->
url
)
return
;
new_entry
->
stream
=
get_travellog_stream
(
This
);
if
(
This
->
travellog
.
loading_pos
==
-
1
)
{
This
->
travellog
.
position
++
;
}
else
{
...
...
dlls/ieframe/ieframe.h
View file @
0f5badf4
...
...
@@ -96,6 +96,7 @@ typedef struct {
typedef
struct
{
WCHAR
*
url
;
IStream
*
stream
;
}
travellog_entry_t
;
typedef
struct
_IDocHostContainerVtbl
...
...
dlls/ieframe/navigate.c
View file @
0f5badf4
...
...
@@ -27,6 +27,7 @@
#include "shlwapi.h"
#include "wininet.h"
#include "mshtml.h"
#include "perhist.h"
#include "resource.h"
#include "wine/debug.h"
...
...
@@ -1058,30 +1059,46 @@ HRESULT go_home(DocHost *This)
return
navigate_url
(
This
,
wszPageName
,
NULL
,
NULL
,
NULL
,
NULL
);
}
HRESULT
go_back
(
DocHost
*
Thi
s
)
static
HRESULT
navigate_history
(
DocHost
*
This
,
unsigned
travellog_po
s
)
{
WCHAR
*
url
;
IPersistHistory
*
persist_history
;
travellog_entry_t
*
entry
;
LARGE_INTEGER
li
;
HRESULT
hres
;
if
(
!
This
->
travellog
.
position
)
{
WARN
(
"No history available
\n
"
);
return
E_
FAI
L
;
if
(
!
This
->
doc_navigate
)
{
FIXME
(
"unsupported doc_navigate FALSE
\n
"
);
return
E_
NOTIMP
L
;
}
This
->
travellog
.
loading_pos
=
This
->
travellog
.
position
-
1
;
url
=
This
->
travellog
.
log
[
This
->
travellog
.
loading_pos
].
url
;
This
->
travellog
.
loading_pos
=
travellog_pos
;
entry
=
This
->
travellog
.
log
+
This
->
travellog
.
loading_pos
;
if
(
This
->
doc_navigate
)
{
hres
=
async_doc_navigate
(
This
,
url
,
NULL
,
NULL
,
0
,
FALSE
);
}
else
{
FIXME
(
"unsupported doc_navigate FALSE
\n
"
);
hres
=
E_NOTIMPL
;
}
if
(
!
entry
->
stream
)
return
async_doc_navigate
(
This
,
entry
->
url
,
NULL
,
NULL
,
0
,
FALSE
);
hres
=
IUnknown_QueryInterface
(
This
->
document
,
&
IID_IPersistHistory
,
(
void
**
)
&
persist_history
);
if
(
FAILED
(
hres
))
return
hres
;
li
.
QuadPart
=
0
;
IStream_Seek
(
entry
->
stream
,
li
,
STREAM_SEEK_SET
,
NULL
);
heap_free
(
url
);
hres
=
IPersistHistory_LoadHistory
(
persist_history
,
entry
->
stream
,
NULL
);
IPersistHistory_Release
(
persist_history
);
return
hres
;
}
HRESULT
go_back
(
DocHost
*
This
)
{
if
(
!
This
->
travellog
.
position
)
{
WARN
(
"No history available
\n
"
);
return
E_FAIL
;
}
return
navigate_history
(
This
,
This
->
travellog
.
position
-
1
);
}
HRESULT
get_location_url
(
DocHost
*
This
,
BSTR
*
ret
)
{
FIXME
(
"semi-stub
\n
"
);
...
...
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