From 2e4e7e1b752f261f9cd73f9d3d4b7ae346acde8e Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Sun, 20 Jun 2004 08:03:12 +0000 Subject: Implement GlobalHistory2::HidePage, fixes bug #142143. 2004-06-20 Christian Persch * embed/mozilla/GlobalHistory.cpp: Implement GlobalHistory2::HidePage, fixes bug #142143. --- ChangeLog | 6 ++++++ embed/mozilla/GlobalHistory.cpp | 24 +++++++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 90cb59c10..bf7be5ffd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-06-20 Christian Persch + + * embed/mozilla/GlobalHistory.cpp: + + Implement GlobalHistory2::HidePage, fixes bug #142143. + 2004-06-20 Christian Persch * src/ephy-notebook.c: (sync_label), (tab_label_style_set_cb), diff --git a/embed/mozilla/GlobalHistory.cpp b/embed/mozilla/GlobalHistory.cpp index d96417a69..352527dae 100644 --- a/embed/mozilla/GlobalHistory.cpp +++ b/embed/mozilla/GlobalHistory.cpp @@ -45,7 +45,8 @@ MozGlobalHistory::~MozGlobalHistory () NS_IMETHODIMP MozGlobalHistory::AddURI(nsIURI *aURI, PRBool aRedirect, PRBool aToplevel) { nsresult rv; - NS_ENSURE_ARG_POINTER(aURI); + + NS_ENSURE_ARG (aURI); PRBool isJavascript; rv = aURI->SchemeIs("javascript", &isJavascript); @@ -98,6 +99,8 @@ NS_IMETHODIMP MozGlobalHistory::AddURI(nsIURI *aURI, PRBool aRedirect, PRBool aT /* boolean isVisited (in nsIURI aURI); */ NS_IMETHODIMP MozGlobalHistory::IsVisited(nsIURI *aURI, PRBool *_retval) { + NS_ENSURE_ARG (aURI); + nsEmbedCString spec; aURI->GetSpec(spec); @@ -109,6 +112,8 @@ NS_IMETHODIMP MozGlobalHistory::IsVisited(nsIURI *aURI, PRBool *_retval) /* void setPageTitle (in nsIURI aURI, in AString aTitle); */ NS_IMETHODIMP MozGlobalHistory::SetPageTitle(nsIURI *aURI, const nsAString & aTitle) { + NS_ENSURE_ARG (aURI); + nsEmbedCString title; NS_UTF16ToCString (nsEmbedString (aTitle), NS_CSTRING_ENCODING_UTF8, title); @@ -122,9 +127,22 @@ NS_IMETHODIMP MozGlobalHistory::SetPageTitle(nsIURI *aURI, const nsAString & aTi } /* void hidePage (in nsIURI url); */ -NS_IMETHODIMP MozGlobalHistory::HidePage(nsIURI *url) +NS_IMETHODIMP MozGlobalHistory::HidePage(nsIURI *aURI) { - return NS_ERROR_NOT_IMPLEMENTED; + NS_ENSURE_ARG (aURI); + + nsEmbedCString spec; + aURI->GetSpec(spec); + + EphyNode *page; + page = ephy_history_get_page (mGlobalHistory, spec.get()); + + if (page) + { + ephy_node_unref (page); + } + + return NS_OK; } /* void removePage (in string aURL); */ -- cgit v1.2.3