]> git.saurik.com Git - wxWidgets.git/commitdiff
Add a WebHistory to the OSX WebKit backend and implement ClearHistory.
authorSteve Lamerton <steve.lamerton@gmail.com>
Fri, 5 Aug 2011 13:56:50 +0000 (13:56 +0000)
committerSteve Lamerton <steve.lamerton@gmail.com>
Fri, 5 Aug 2011 13:56:50 +0000 (13:56 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68557 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/osx/webview_webkit.h
src/osx/webview_webkit.mm

index 2e5a75b45e8876546b13d309cfe1c67c0cb9911c..b9e228f36818ecaf41dcdc3a4ac0d596c69f86b7 100644 (file)
@@ -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<wxSharedPtr<wxWebHistoryItem> > GetBackwardHistory()
             { return wxVector<wxSharedPtr<wxWebHistoryItem> >(); }
index 37b6eb9cbbe8db6623ca1641f081b48aaaad1e22..e6923c2b5073326d83cc0b2682ffc42b71825466 100644 (file)
@@ -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];