aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-06-20 15:52:01 +0800
committerChristian Persch <chpe@src.gnome.org>2004-06-20 15:52:01 +0800
commitf64293d59e4e718e19a03654814d0bb3dd52b9c6 (patch)
treec78bb4b5bd64b514cd72cfd713d6bf25b2a527b8
parenteb05bd3e9db17d022de1b2ec7e8a4be748c10bcc (diff)
downloadgsoc2013-epiphany-f64293d59e4e718e19a03654814d0bb3dd52b9c6.tar
gsoc2013-epiphany-f64293d59e4e718e19a03654814d0bb3dd52b9c6.tar.gz
gsoc2013-epiphany-f64293d59e4e718e19a03654814d0bb3dd52b9c6.tar.bz2
gsoc2013-epiphany-f64293d59e4e718e19a03654814d0bb3dd52b9c6.tar.lz
gsoc2013-epiphany-f64293d59e4e718e19a03654814d0bb3dd52b9c6.tar.xz
gsoc2013-epiphany-f64293d59e4e718e19a03654814d0bb3dd52b9c6.tar.zst
gsoc2013-epiphany-f64293d59e4e718e19a03654814d0bb3dd52b9c6.zip
Implement GlobalHistory[2]::HidePage, fixes bug #142143.
2004-06-20 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/GlobalHistory.cpp: Implement GlobalHistory[2]::HidePage, fixes bug #142143.
-rw-r--r--ChangeLog8
-rw-r--r--embed/mozilla/GlobalHistory.cpp47
2 files changed, 46 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 30cbbd294..4679a2951 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,15 @@
+2004-06-20 Christian Persch <chpe@cvs.gnome.org>
+
+ * embed/mozilla/GlobalHistory.cpp:
+
+ Implement GlobalHistory[2]::HidePage, fixes bug #142143.
+
2004-06-17 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/GtkNSSClientAuthDialogs.cpp:
* embed/mozilla/GtkNSSDialogs.cpp:
- Escape strings before using the with markup in labels.
+ Escape strings before using them with markup in labels.
Patch by Crispin Flowerday.
2004-06-15 Christian Persch <chpe@cvs.gnome.org>
diff --git a/embed/mozilla/GlobalHistory.cpp b/embed/mozilla/GlobalHistory.cpp
index c0be62009..5ad61d660 100644
--- a/embed/mozilla/GlobalHistory.cpp
+++ b/embed/mozilla/GlobalHistory.cpp
@@ -51,7 +51,7 @@ 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);
@@ -104,7 +104,7 @@ 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_POINTER(aURI);
+ NS_ENSURE_ARG (aURI);
nsCAutoString spec;
aURI->GetSpec(spec);
@@ -117,12 +117,14 @@ 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_POINTER(aURI);
+ NS_ENSURE_ARG (aURI);
const nsACString &title = NS_ConvertUTF16toUTF8(aTitle);
+ nsresult rv;
nsCAutoString spec;
- aURI->GetSpec(spec);
+ rv = aURI->GetSpec(spec);
+ NS_ENSURE_SUCCESS (rv, NS_ERROR_FAILURE);
ephy_history_set_page_title (mGlobalHistory, spec.get(),
PromiseFlatCString(title).get());
@@ -131,9 +133,24 @@ 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);
+
+ nsresult rv;
+ nsCAutoString spec;
+ rv = aURI->GetSpec(spec);
+ NS_ENSURE_SUCCESS (rv, NS_ERROR_FAILURE);
+
+ EphyNode *page;
+ page = ephy_history_get_page (mGlobalHistory, spec.get());
+
+ if (page)
+ {
+ ephy_node_unref (page);
+ }
+
+ return NS_OK;
}
#else
@@ -141,6 +158,8 @@ NS_IMETHODIMP MozGlobalHistory::HidePage(nsIURI *url)
/* void addPage (in string aURL); */
NS_IMETHODIMP MozGlobalHistory::AddPage (const char *aURL)
{
+ NS_ENSURE_ARG (aURL);
+
ephy_history_add_page (mGlobalHistory, aURL);
return NS_OK;
@@ -149,6 +168,8 @@ NS_IMETHODIMP MozGlobalHistory::AddPage (const char *aURL)
/* boolean isVisited (in string aURL); */
NS_IMETHODIMP MozGlobalHistory::IsVisited (const char *aURL, PRBool *_retval)
{
+ NS_ENSURE_ARG (aURL);
+
*_retval = ephy_history_is_page_visited (mGlobalHistory, aURL);
return NS_OK;
@@ -158,6 +179,7 @@ NS_IMETHODIMP MozGlobalHistory::IsVisited (const char *aURL, PRBool *_retval)
NS_IMETHODIMP MozGlobalHistory::SetPageTitle (const char *aURL,
const PRUnichar *aTitle)
{
+ NS_ENSURE_ARG (aURL);
const nsACString &title = NS_ConvertUCS2toUTF8 (aTitle);
ephy_history_set_page_title (mGlobalHistory, aURL, PromiseFlatCString(title).get());
@@ -166,10 +188,19 @@ NS_IMETHODIMP MozGlobalHistory::SetPageTitle (const char *aURL,
return NS_OK;
}
-NS_IMETHODIMP MozGlobalHistory::HidePage(const char *url)
+NS_IMETHODIMP MozGlobalHistory::HidePage(const char *aURL)
{
- return NS_ERROR_NOT_IMPLEMENTED;
+ NS_ENSURE_ARG (aURL);
+
+ EphyNode *page;
+ page = ephy_history_get_page (mGlobalHistory, aURL);
+
+ if (page)
+ {
+ ephy_node_unref (page);
+ }
+ return NS_OK;
}
#endif /* MOZILLA_SNAPSHOT > 13 */