From: Steve Lamerton Date: Fri, 5 Aug 2011 13:56:50 +0000 (+0000) Subject: Add a WebHistory to the OSX WebKit backend and implement ClearHistory. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/7c36630b570a7e8754d720313b6ea37724f561b0 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 --- diff --git a/include/wx/osx/webview_webkit.h b/include/wx/osx/webview_webkit.h index 2e5a75b45e..b9e228f368 100644 --- a/include/wx/osx/webview_webkit.h +++ b/include/wx/osx/webview_webkit.h @@ -83,7 +83,7 @@ public: virtual bool IsBusy() { return m_busy; } //History functions - virtual void ClearHistory() {} + virtual void ClearHistory(); virtual void EnableHistory(bool enable = true); virtual wxVector > GetBackwardHistory() { return wxVector >(); } diff --git a/src/osx/webview_webkit.mm b/src/osx/webview_webkit.mm index 37b6eb9cbb..e6923c2b50 100644 --- a/src/osx/webview_webkit.mm +++ b/src/osx/webview_webkit.mm @@ -440,6 +440,10 @@ bool wxWebViewWebKit::Create(wxWindow *parent, [[MyPolicyDelegate alloc] initWithWxWindow: this]; [m_webView setPolicyDelegate:myPolicyDelegate]; + + // add history + WebHistory* history = [[WebHistory alloc] init]; + [WebHistory setOptionalSharedHistory:history]; InternalLoadURL(strURL); return true; @@ -952,6 +956,11 @@ void wxWebViewWebKit::EnableHistory(bool enable) [m_webView setMaintainsBackForwardList:enable]; } +void wxWebViewWebKit::ClearHistory() +{ + [[WebHistory optionalSharedHistory] removeAllItems]; +} + bool wxWebViewWebKit::CanUndo() { return [[m_webView undoManager] canUndo];