aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-09-06 00:41:12 +0800
committerChristian Persch <chpe@src.gnome.org>2005-09-06 00:41:12 +0800
commit0616ec5e16c2d2d435339d1842af79de9793af0e (patch)
tree8b6ab1a3a0f1f36d0f8d45970d6550c036ae88ed /embed
parent2400a887ee9deb7acb756629e0fe73770a385e07 (diff)
downloadgsoc2013-epiphany-0616ec5e16c2d2d435339d1842af79de9793af0e.tar.gz
gsoc2013-epiphany-0616ec5e16c2d2d435339d1842af79de9793af0e.tar.zst
gsoc2013-epiphany-0616ec5e16c2d2d435339d1842af79de9793af0e.zip
Implement [SG]etGeckoURIFlags for gecko 1.9.
2005-09-05 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/GlobalHistory.cpp: * embed/ephy-history.h: Implement [SG]etGeckoURIFlags for gecko 1.9.
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-history.h3
-rw-r--r--embed/mozilla/GlobalHistory.cpp41
2 files changed, 37 insertions, 7 deletions
diff --git a/embed/ephy-history.h b/embed/ephy-history.h
index fcaf7d039..ef4b62d1e 100644
--- a/embed/ephy-history.h
+++ b/embed/ephy-history.h
@@ -48,7 +48,8 @@ enum
EPHY_NODE_PAGE_PROP_HOST_ID = 7,
EPHY_NODE_PAGE_PROP_PRIORITY = 8,
EPHY_NODE_PAGE_PROP_ICON = 9,
- EPHY_NODE_HOST_PROP_ZOOM = 10
+ EPHY_NODE_HOST_PROP_ZOOM = 10,
+ EPHY_NODE_PAGE_PROP_GECKO_FLAGS = 11
};
struct _EphyHistory
diff --git a/embed/mozilla/GlobalHistory.cpp b/embed/mozilla/GlobalHistory.cpp
index 27d71b9ab..90b65c020 100644
--- a/embed/mozilla/GlobalHistory.cpp
+++ b/embed/mozilla/GlobalHistory.cpp
@@ -129,17 +129,46 @@ NS_IMETHODIMP MozGlobalHistory::SetPageTitle(nsIURI *aURI, const nsAString & aTi
#ifdef HAVE_GECKO_1_9
/* unsigned long getURIGeckoFlags(in nsIURI aURI); */
NS_IMETHODIMP
-GlobalHistory::GetURIGeckoFlags(nsIURI *aURI, PRUint32* aFlags)
+MozGlobalHistory::GetURIGeckoFlags(nsIURI *aURI, PRUint32* aFlags)
{
-#error Implement me!
- return NS_ERROR_NOT_IMPLEMENTED:
+ nsEmbedCString spec;
+ aURI->GetSpec(spec);
+
+ EphyNode *page = ephy_history_get_page (mGlobalHistory, spec.get());
+
+ GValue value = { 0, };
+ if (page != NULL &&
+ ephy_node_get_property (page, EPHY_NODE_PAGE_PROP_GECKO_FLAGS, &value))
+ {
+ *aFlags = (PRUint32) (gulong) g_value_get_long (&value);
+ g_value_unset (&value);
+
+ return NS_OK;
+ }
+
+ return NS_ERROR_FAILURE;
}
/* void setURIGeckoFlags(in nsIURI aURI, in unsigned long aFlags); */
NS_IMETHODIMP
-GlobalHistory::SetURIGeckoFlags(nsIURI *aURI, PRUint32 aFlags)
+MozGlobalHistory::SetURIGeckoFlags(nsIURI *aURI, PRUint32 aFlags)
{
-#error Implement me!
- return NS_ERROR_NOT_IMPLEMENTED:
+ nsEmbedCString spec;
+ aURI->GetSpec(spec);
+
+ EphyNode *page = ephy_history_get_page (mGlobalHistory, spec.get());
+ if (page != NULL)
+ {
+ GValue value = { 0, };
+
+ g_value_init (&value, G_TYPE_LONG);
+ g_value_set_long (&value, (long) (gulong) aFlags);
+ ephy_node_set_property (page, EPHY_NODE_PAGE_PROP_GECKO_FLAGS, &value);
+ g_value_unset (&value);
+
+ return NS_OK;
+ }
+
+ return NS_ERROR_FAILURE;
}
#endif /* HAVE_GECKO_1_9 */