Add a WebHistory to the OSX WebKit backend and implement ClearHistory.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68557 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Steve Lamerton
2011-08-05 13:56:50 +00:00
parent 2f70baea2f
commit 7c36630b57
2 changed files with 10 additions and 1 deletions

View File

@@ -83,7 +83,7 @@ public:
virtual bool IsBusy() { return m_busy; } virtual bool IsBusy() { return m_busy; }
//History functions //History functions
virtual void ClearHistory() {} virtual void ClearHistory();
virtual void EnableHistory(bool enable = true); virtual void EnableHistory(bool enable = true);
virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetBackwardHistory() virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetBackwardHistory()
{ return wxVector<wxSharedPtr<wxWebHistoryItem> >(); } { return wxVector<wxSharedPtr<wxWebHistoryItem> >(); }

View File

@@ -440,6 +440,10 @@ bool wxWebViewWebKit::Create(wxWindow *parent,
[[MyPolicyDelegate alloc] initWithWxWindow: this]; [[MyPolicyDelegate alloc] initWithWxWindow: this];
[m_webView setPolicyDelegate:myPolicyDelegate]; [m_webView setPolicyDelegate:myPolicyDelegate];
// add history
WebHistory* history = [[WebHistory alloc] init];
[WebHistory setOptionalSharedHistory:history];
InternalLoadURL(strURL); InternalLoadURL(strURL);
return true; return true;
@@ -952,6 +956,11 @@ void wxWebViewWebKit::EnableHistory(bool enable)
[m_webView setMaintainsBackForwardList:enable]; [m_webView setMaintainsBackForwardList:enable];
} }
void wxWebViewWebKit::ClearHistory()
{
[[WebHistory optionalSharedHistory] removeAllItems];
}
bool wxWebViewWebKit::CanUndo() bool wxWebViewWebKit::CanUndo()
{ {
return [[m_webView undoManager] canUndo]; return [[m_webView undoManager] canUndo];