epiphany r8632 - in trunk: . embed embed/webkit src



Author: xan
Date: Fri Dec 12 00:09:41 2008
New Revision: 8632
URL: http://svn.gnome.org/viewvc/epiphany?rev=8632&view=rev

Log:
Port ephy to use libsoup for cookies.

Removed:
   trunk/embed/ephy-cookie-manager.c
   trunk/embed/ephy-cookie-manager.h
Modified:
   trunk/configure.ac
   trunk/embed/Makefile.am
   trunk/embed/webkit/webkit-embed-single.c
   trunk/src/Makefile.am
   trunk/src/epiphany.defs
   trunk/src/epiphany.h.in
   trunk/src/epiphany.override
   trunk/src/pdm-dialog.c

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Fri Dec 12 00:09:41 2008
@@ -112,6 +112,7 @@
 LIBSTARTUP_NOTIFICATION_REQUIRED=0.5
 LIBNOTIFY_REQUIRED=0.4
 DBUS_GLIB_REQUIRED=0.35
+LIBSOUP_REQUIRED=2.25.0
 
 PKG_CHECK_EXISTS([libnotify >= $LIBNOTIFY_REQUIRED],[have_libnotify=yes],[have_libnotify=no])
 
@@ -144,6 +145,7 @@
 		  gconf-2.0
 		  libstartup-notification-1.0 >= $LIBSTARTUP_NOTIFICATION_REQUIRED
 		  $LIBNOTIFY_PACKAGE
+                  libsoup-2.4 >= $LIBSOUP_REQUIRED
 		  ])
 AC_SUBST([DEPENDENCIES_CFLAGS])
 AC_SUBST([DEPENDENCIES_LIBS])

Modified: trunk/embed/Makefile.am
==============================================================================
--- trunk/embed/Makefile.am	(original)
+++ trunk/embed/Makefile.am	Fri Dec 12 00:09:41 2008
@@ -21,7 +21,6 @@
 	ephy-adblock-manager.h		\
 	ephy-base-embed.h               \
 	ephy-command-manager.h		\
-	ephy-cookie-manager.h		\
 	ephy-embed.h			\
 	ephy-embed-container.h          \
 	ephy-embed-event.h		\
@@ -45,7 +44,6 @@
 	ephy-base-embed.c               \
 	downloader-view.c		\
 	ephy-command-manager.c		\
-	ephy-cookie-manager.c		\
 	ephy-download.c			\
 	ephy-embed.c			\
 	ephy-embed-container.c          \

Modified: trunk/embed/webkit/webkit-embed-single.c
==============================================================================
--- trunk/embed/webkit/webkit-embed-single.c	(original)
+++ trunk/embed/webkit/webkit-embed-single.c	Fri Dec 12 00:09:41 2008
@@ -24,7 +24,6 @@
 #include "webkit-embed-single.h"
 #include "webkit-embed-prefs.h"
 #include "ephy-embed-single.h"
-#include "ephy-cookie-manager.h"
 #include "ephy-password-manager.h"
 #include "ephy-permission-manager.h"
 
@@ -46,7 +45,6 @@
 static void webkit_embed_single_class_init     (WebKitEmbedSingleClass *klass);
 static void webkit_embed_single_init           (WebKitEmbedSingle *wes);
 static void ephy_embed_single_iface_init       (EphyEmbedSingleIface *iface);
-static void ephy_cookie_manager_iface_init     (EphyCookieManagerIface *iface);
 static void ephy_password_manager_iface_init   (EphyPasswordManagerIface *iface);
 static void ephy_permission_manager_iface_init (EphyPermissionManagerIface *iface);
 
@@ -61,8 +59,6 @@
 G_DEFINE_TYPE_WITH_CODE (WebKitEmbedSingle, webkit_embed_single, G_TYPE_OBJECT,
                          G_IMPLEMENT_INTERFACE (EPHY_TYPE_EMBED_SINGLE,
                                                 ephy_embed_single_iface_init)
-                         G_IMPLEMENT_INTERFACE (EPHY_TYPE_COOKIE_MANAGER,
-                                                ephy_cookie_manager_iface_init)
                          G_IMPLEMENT_INTERFACE (EPHY_TYPE_PASSWORD_MANAGER,
                                                 ephy_password_manager_iface_init)
                          G_IMPLEMENT_INTERFACE (EPHY_TYPE_CERTIFICATE_MANAGER,
@@ -73,8 +69,6 @@
 G_DEFINE_TYPE_WITH_CODE (WebKitEmbedSingle, webkit_embed_single, G_TYPE_OBJECT,
                          G_IMPLEMENT_INTERFACE (EPHY_TYPE_EMBED_SINGLE,
                                                 ephy_embed_single_iface_init)
-                         G_IMPLEMENT_INTERFACE (EPHY_TYPE_COOKIE_MANAGER,
-                                                ephy_cookie_manager_iface_init)
                          G_IMPLEMENT_INTERFACE (EPHY_TYPE_PASSWORD_MANAGER,
                                                 ephy_password_manager_iface_init)
                          G_IMPLEMENT_INTERFACE (EPHY_TYPE_PERMISSION_MANAGER,
@@ -147,23 +141,6 @@
 }
 
 static GList *
-impl_list_cookies (EphyCookieManager *manager)
-{
-  return NULL;
-}
-
-static void
-impl_remove_cookie (EphyCookieManager *manager,
-                    const EphyCookie *cookie)
-{
-}
-
-static void
-impl_clear_cookies (EphyCookieManager *manager)
-{
-}
-
-static GList *
 impl_list_passwords (EphyPasswordManager *manager)
 {
   return NULL;
@@ -332,14 +309,6 @@
 }
 
 static void
-ephy_cookie_manager_iface_init (EphyCookieManagerIface *iface)
-{
-  iface->list = impl_list_cookies;
-  iface->remove = impl_remove_cookie;
-  iface->clear = impl_clear_cookies;
-}
-
-static void
 ephy_password_manager_iface_init (EphyPasswordManagerIface *iface)
 {
   iface->add = impl_add_password;

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Fri Dec 12 00:09:41 2008
@@ -332,7 +332,6 @@
 
 BINDING_HEADERS_SRCDIR_IN = \
 	embed/ephy-command-manager.h			\
-	embed/ephy-cookie-manager.h			\
 	embed/ephy-embed-event.h			\
 	embed/ephy-embed-factory.h			\
 	embed/ephy-embed.h				\

Modified: trunk/src/epiphany.defs
==============================================================================
--- trunk/src/epiphany.defs	(original)
+++ trunk/src/epiphany.defs	Fri Dec 12 00:09:41 2008
@@ -20,12 +20,6 @@
   (gtype-id "EPHY_TYPE_COMMAND_MANAGER")
 )
 
-(define-interface CookieManager
-  (in-module "Ephy")
-  (c-name "EphyCookieManager")
-  (gtype-id "EPHY_TYPE_COOKIE_MANAGER")
-)
-
 (define-object Dialog
   (in-module "Ephy")
   (parent "GObject")
@@ -475,57 +469,6 @@
 
 
 
-;; From ../../embed/ephy-cookie-manager.h
-
-(define-function ephy_cookie_get_type
-  (c-name "ephy_cookie_get_type")
-  (return-type "GType")
-)
-
-(define-function ephy_cookie_new
-  (c-name "ephy_cookie_new")
-  (is-constructor-of "EphyCookie")
-  (return-type "EphyCookie*")
-)
-
-(define-method copy
-  (of-object "EphyCookie")
-  (c-name "ephy_cookie_copy")
-  (return-type "EphyCookie*")
-)
-
-(define-method free
-  (of-object "EphyCookie")
-  (c-name "ephy_cookie_free")
-  (return-type "none")
-)
-
-(define-function ephy_cookie_manager_get_type
-  (c-name "ephy_cookie_manager_get_type")
-  (return-type "GType")
-)
-
-(define-method list_cookies
-  (of-object "EphyCookieManager")
-  (c-name "ephy_cookie_manager_list_cookies")
-  (return-type "GList*")
-)
-
-(define-method remove_cookie
-  (of-object "EphyCookieManager")
-  (c-name "ephy_cookie_manager_remove_cookie")
-  (return-type "none")
-  (parameters
-    '("const-EphyCookie*" "cookie")
-  )
-)
-
-(define-method clear
-  (of-object "EphyCookieManager")
-  (c-name "ephy_cookie_manager_clear")
-  (return-type "none")
-)
-
 ;; From ../../embed/ephy-embed-container.h
 
 (define-method set_active_child
@@ -3520,22 +3463,6 @@
 
 ;; Boxed types ...
 
-(define-boxed Cookie
-  (in-module "Ephy")
-  (c-name "EphyCookie")
-  (gtype-id "EPHY_TYPE_COOKIE")
-  (fields
-    '("char*" "name")
-    '("char*" "value")
-    '("char*" "domain")
-    '("char*" "path")
-    '("gulong" "expires")
-    '("glong" "real_expires")
-    '("guint" "is_secure")
-    '("guint" "is_session")
-  )
-)
-
 (define-boxed PasswordInfo
   (in-module "Ephy")
   (c-name "EphyPasswordInfo")

Modified: trunk/src/epiphany.h.in
==============================================================================
--- trunk/src/epiphany.h.in	(original)
+++ trunk/src/epiphany.h.in	Fri Dec 12 00:09:41 2008
@@ -39,7 +39,6 @@
 #include <epiphany/ephy-bookmarks.h>
 #include <epiphany/ephy-bookmarks-type-builtins.h>
 #include <epiphany/ephy-command-manager.h>
-#include <epiphany/ephy-cookie-manager.h>
 #include <epiphany/ephy-dialog.h>
 #include <epiphany/ephy-embed-container.h>
 #include <epiphany/ephy-embed-event.h>

Modified: trunk/src/epiphany.override
==============================================================================
--- trunk/src/epiphany.override	(original)
+++ trunk/src/epiphany.override	Fri Dec 12 00:09:41 2008
@@ -28,7 +28,6 @@
 #include "ephy-bookmarks.h"
 #include "ephy-bookmarks-type-builtins.h"
 #include "ephy-command-manager.h"
-#include "ephy-cookie-manager.h"
 #include "ephy-dialog.h"
 #include "ephy-embed-event.h"
 #include "ephy-embed-factory.h"
@@ -360,18 +359,6 @@
 
     return _helper_wrap_boxed_glist (EPHY_TYPE_PASSWORD_INFO, list);
 }
-%%
-override ephy_cookie_manager_list_cookies noargs
-static PyObject *
-_wrap_ephy_cookie_manager_list_cookies(PyGObject *self)
-{
-    GList *list;
-
-    list = ephy_cookie_manager_list_cookies(EPHY_COOKIE_MANAGER (self->obj));
-
-    return _helper_wrap_boxed_glist (EPHY_TYPE_COOKIE, list);
-}
-%%
 //override ephy_permission_manager_list_permissions kwargs
 // static PyObject *
 // _wrap_ephy_permission_manager_list_permissions (PyGObject *self,

Modified: trunk/src/pdm-dialog.c
==============================================================================
--- trunk/src/pdm-dialog.c	(original)
+++ trunk/src/pdm-dialog.c	Fri Dec 12 00:09:41 2008
@@ -24,7 +24,6 @@
 
 #include "pdm-dialog.h"
 #include "ephy-shell.h"
-#include "ephy-cookie-manager.h"
 #include "ephy-file-helpers.h"
 #include "ephy-password-manager.h"
 #include "ephy-gui.h"
@@ -39,8 +38,11 @@
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
+#include <libsoup/soup.h>
+#include <webkit/webkit.h>
 
 #include <string.h>
+#include <time.h>
 
 typedef struct PdmActionInfo PdmActionInfo;
 	
@@ -123,12 +125,12 @@
 	{ "pdm_dialog",			NULL, PT_NORMAL, 0 },
 	{ "pdm_notebook",		NULL, PT_NORMAL, 0 },
 
-	{ "cookies_treeview",	   	NULL, PT_NORMAL, 0 },
-	{ "cookies_remove_button",     	NULL, PT_NORMAL, 0 },
-	{ "cookies_properties_button", 	NULL, PT_NORMAL, 0 },
-	{ "passwords_treeview",	       	NULL, PT_NORMAL, 0 },
-	{ "passwords_remove_button",   	NULL, PT_NORMAL, 0 },
-	{ "passwords_show_button",     	NULL, PT_NORMAL, 0 },
+	{ "cookies_treeview",		NULL, PT_NORMAL, 0 },
+	{ "cookies_remove_button",	NULL, PT_NORMAL, 0 },
+	{ "cookies_properties_button",	NULL, PT_NORMAL, 0 },
+	{ "passwords_treeview",		NULL, PT_NORMAL, 0 },
+	{ "passwords_remove_button",	NULL, PT_NORMAL, 0 },
+	{ "passwords_show_button",	NULL, PT_NORMAL, 0 },
 
 	{ NULL }
 };
@@ -137,7 +139,7 @@
 static void pdm_dialog_init		(PdmDialog *dialog);
 static void pdm_dialog_finalize		(GObject *object);
 
-static void passwords_changed_cb 		(EphyPasswordManager *manager,
+static void passwords_changed_cb		(EphyPasswordManager *manager,
 						 PdmDialog *dialog);
 
 
@@ -186,6 +188,22 @@
 	guint num_checked;
 } PdmClearAllDialogButtons;
 
+static SoupCookieJar*
+get_cookie_jar ()
+{
+	GSList *l;
+        /* This is not finished webkit API, just testing */
+	SoupSession* session = webkit_web_view_get_session ();
+	
+	for (l = soup_session_get_features (session); l; l = l->next)
+	{
+	    if (SOUP_IS_COOKIE_JAR (l->data))
+	            return l->data;
+	}
+
+	return NULL;
+}
+
 static void
 clear_all_dialog_release_cb (PdmClearAllDialogButtons *data)
 {
@@ -193,6 +211,18 @@
 }
 
 static void
+clear_all_cookies (SoupCookieJar *jar)
+{
+	GSList *l, *p;
+
+	l = soup_cookie_jar_all_cookies (jar);
+	for (p = l; p; p = p->next)
+		soup_cookie_jar_delete_cookie (jar, (SoupCookie*)p->data);
+
+	soup_cookies_free (l);
+}
+
+static void
 clear_all_dialog_response_cb (GtkDialog *dialog,
 			      int response,
 			      PdmClearAllDialogButtons *checkbuttons)
@@ -208,7 +238,7 @@
 	if (response == GTK_RESPONSE_OK)
 	{
 		if (gtk_toggle_button_get_active 
-		    	(GTK_TOGGLE_BUTTON (checkbuttons->checkbutton_history)))
+			(GTK_TOGGLE_BUTTON (checkbuttons->checkbutton_history)))
 		{
 			EphyEmbedShell *shell;
 			EphyHistory *history;
@@ -218,17 +248,16 @@
 			ephy_history_clear (history);
 		}
 		if (gtk_toggle_button_get_active
-		    	(GTK_TOGGLE_BUTTON (checkbuttons->checkbutton_cookies)))
+			(GTK_TOGGLE_BUTTON (checkbuttons->checkbutton_cookies)))
 		{
-			EphyCookieManager *manager;
+			SoupCookieJar *jar;
 
-			manager = EPHY_COOKIE_MANAGER (ephy_embed_shell_get_embed_single
-						       (EPHY_EMBED_SHELL (ephy_shell)));
+			jar = get_cookie_jar ();
 
-			ephy_cookie_manager_clear (manager);
+			clear_all_cookies (jar);
 		}
 		if (gtk_toggle_button_get_active
-		    	(GTK_TOGGLE_BUTTON (checkbuttons->checkbutton_passwords)))
+			(GTK_TOGGLE_BUTTON (checkbuttons->checkbutton_passwords)))
 		{
 			EphyPasswordManager *manager;
 
@@ -262,7 +291,7 @@
 			}
 		}
 		if (gtk_toggle_button_get_active
-		    	(GTK_TOGGLE_BUTTON (checkbuttons->checkbutton_cache)))
+			(GTK_TOGGLE_BUTTON (checkbuttons->checkbutton_cache)))
 		{
 			EphyEmbedShell *shell;
 			EphyEmbedSingle *single;
@@ -406,7 +435,7 @@
 	label = gtk_label_new (NULL);
 	gtk_label_set_markup (GTK_LABEL (label),
 			      _("<small><i><b>Note:</b> You cannot undo this action. "
-			        "The data you are choosing to clear "
+				"The data you are choosing to clear "
 				"will be deleted forever.</i></small>"));
 	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
 			    label, FALSE, FALSE, 0);
@@ -588,7 +617,7 @@
 
 static void
 show_cookies_properties (PdmDialog *dialog,
-			 EphyCookie *info)
+			 SoupCookie *info)
 {
 	GtkWidget *gdialog;
 	GtkWidget *table;
@@ -659,7 +688,7 @@
 	gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3,
 			  GTK_FILL, GTK_FILL, 0, 0);
 
-	label = gtk_label_new (info->is_secure ? _("Encrypted connections only") : _("Any type of connection") );
+	label = gtk_label_new (info->secure ? _("Encrypted connections only") : _("Any type of connection") );
 	gtk_label_set_selectable (GTK_LABEL (label), TRUE);
 	gtk_misc_set_alignment (GTK_MISC (label), 0, 0);
 	gtk_widget_show (label);
@@ -674,14 +703,16 @@
 	gtk_table_attach (GTK_TABLE (table), label, 0, 1, 3, 4,
 			  GTK_FILL, GTK_FILL, 0, 0);
 
-	if (info->is_session)
+	if (info->expires == NULL)
 	{
+		/* Session cookie */
 		str = g_strdup (_("End of current session"));
 	}
 	else
 	{
 		struct tm t;
-		str = eel_strdup_strftime ("%c", localtime_r (&info->expires, &t));
+		time_t out = soup_date_to_time_t(info->expires);
+		str = eel_strdup_strftime ("%c", localtime_r (&out, &t));
 	}
 	label = gtk_label_new (str);
 	g_free (str);
@@ -711,7 +742,7 @@
 	GValue val = {0, };
 	GtkTreeIter iter;
 	GtkTreePath *path;
-	EphyCookie *cookie;
+	SoupCookie *cookie;
 	GList *l;
 	GtkTreeSelection *selection;
 
@@ -723,7 +754,7 @@
 	gtk_tree_model_get_iter (model, &iter, path);
 	gtk_tree_model_get_value
 		(model, &iter, COL_COOKIES_DATA, &val);
-	cookie = (EphyCookie *) g_value_get_boxed (&val);
+	cookie = (SoupCookie *) g_value_get_boxed (&val);
 
 	show_cookies_properties (dialog, cookie);
 
@@ -792,7 +823,7 @@
 					G_TYPE_STRING,
 					G_TYPE_STRING,
 					G_TYPE_STRING,
-					EPHY_TYPE_COOKIE);
+					SOUP_TYPE_COOKIE);
 	gtk_tree_view_set_model (treeview, GTK_TREE_MODEL(liststore));
 	gtk_tree_view_set_headers_visible (treeview, TRUE);
 	selection = gtk_tree_view_get_selection (treeview);
@@ -844,19 +875,8 @@
 }
 
 static gboolean
-compare_cookies (const EphyCookie *cookie1,
-		 const EphyCookie *cookie2)
-{
-	g_return_val_if_fail (cookie1 != NULL || cookie2 != NULL, FALSE);
-
-	return (strcmp (cookie1->domain, cookie2->domain) == 0
-		&& strcmp (cookie1->path, cookie2->path) == 0
-		&& strcmp (cookie1->name, cookie2->name) == 0);
-}
-
-static gboolean
 cookie_to_iter (GtkTreeModel *model,
-		const EphyCookie *cookie,
+		const SoupCookie *cookie,
 		GtkTreeIter *iter)
 {
 	gboolean valid;
@@ -866,15 +886,15 @@
 
 	while (valid)
 	{
-		EphyCookie *data;
+		SoupCookie *data;
 
 		gtk_tree_model_get (model, iter,
 				    COL_COOKIES_DATA, &data,
 				    -1);
 
-		found = compare_cookies (cookie, data);
+		found = soup_cookie_equal (cookie, data);
 
-		ephy_cookie_free (data);
+		soup_cookie_free (data);
 
 		if (found) break;
 
@@ -885,20 +905,9 @@
 }
 
 static void
-cookie_added_cb (EphyCookieManager *manager,
-		 const EphyCookie *cookie,
-		 PdmDialog *dialog)
-{
-	PdmActionInfo *info = dialog->priv->cookies;
-	
-	LOG ("cookie_added_cb");
-
-	info->add (info, (gpointer) ephy_cookie_copy (cookie));
-}
-
-static void
-cookie_changed_cb (EphyCookieManager *manager,
-		   const EphyCookie *cookie,
+cookie_changed_cb (SoupCookieJar *jar,
+		   const SoupCookie *old_cookie,
+		   const SoupCookie *new_cookie,
 		   PdmDialog *dialog)
 {
 	PdmActionInfo *info = dialog->priv->cookies;
@@ -906,48 +915,30 @@
 
 	LOG ("cookie_changed_cb");
 
-	if (cookie_to_iter (info->model, cookie, &iter))
-	{
-		gtk_list_store_remove (GTK_LIST_STORE (info->model), &iter);		
-		info->add (info, (gpointer) ephy_cookie_copy (cookie));
-	}
-	else
-	{
-		g_warning ("Unable to find changed cookie in list!\n");
-	}
-}
-
-static void
-cookie_deleted_cb (EphyCookieManager *manager,
-		   const EphyCookie *cookie,
-		   PdmDialog *dialog)
-{
-	PdmActionInfo *info = dialog->priv->cookies;
-	GtkTreeIter iter;
-
-	LOG ("cookie_deleted_cb");
+	g_return_if_fail (info);
 
-	if (cookie_to_iter (info->model, cookie, &iter))
+	if (old_cookie)
 	{
-		gtk_list_store_remove (GTK_LIST_STORE (info->model), &iter);		
+	        /* Cookie changed or deleted, let's get rid of the old one
+		   in any case */
+		if (cookie_to_iter (info->model, old_cookie, &iter))
+		{
+			gtk_list_store_remove (GTK_LIST_STORE (info->model), &iter);
+		}
+		else
+		{
+		        g_warning ("Unable to find changed cookie in list!\n");
+		}
 	}
-	else
+
+	if (new_cookie)
 	{
-		g_warning ("Unable to find deleted cookie in list!\n");
+	        /* Cookie changed or added, let's add the new cookie in
+		   any case */
+		info->add (info, (gpointer) soup_cookie_copy (new_cookie));
 	}
 }
 
-static void
-cookies_cleared_cb (EphyCookieManager *manager,
-		    PdmDialog *dialog)
-{
-	PdmActionInfo *info = dialog->priv->cookies;
-
-	LOG ("cookies_cleared_cb");
-
-	gtk_list_store_clear (GTK_LIST_STORE (info->model));
-}
-
 static gboolean
 cookie_host_to_iter (GtkTreeModel *model,
 		     const char *key1,
@@ -1039,15 +1030,13 @@
 static void
 pdm_dialog_fill_cookies_list (PdmActionInfo *info)
 {
-	EphyCookieManager *manager;
-	GList *list, *l;
+	SoupCookieJar *jar;
+	GSList *list, *l;
 
 	g_assert (info->filled == FALSE);
 
-	manager = EPHY_COOKIE_MANAGER (ephy_embed_shell_get_embed_single
-			(EPHY_EMBED_SHELL (ephy_shell)));
-
-	list = ephy_cookie_manager_list_cookies (manager);
+	jar = get_cookie_jar ();
+	list = soup_cookie_jar_all_cookies (jar);
 
 	for (l = list; l != NULL; l = l->next)
 	{
@@ -1055,7 +1044,7 @@
 	}
 
 	/* the element data has been consumed, so we need only to free the list */
-	g_list_free (list);
+	g_slist_free (list);
 
 	/* Now turn on sorting */
 	gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (info->model),
@@ -1068,15 +1057,8 @@
 	
 	info->filled = TRUE;
 
-	/* Now connect the callbacks on the EphyCookieManager */
-	g_signal_connect (manager, "cookie-added",
-			 G_CALLBACK (cookie_added_cb), info->dialog);
-	g_signal_connect (manager, "cookie-changed",
-			 G_CALLBACK (cookie_changed_cb), info->dialog);
-	g_signal_connect (manager, "cookie-deleted",
-			 G_CALLBACK (cookie_deleted_cb), info->dialog);
-	g_signal_connect (manager, "cookies-cleared",
-			 G_CALLBACK (cookies_cleared_cb), info->dialog);
+	g_signal_connect (jar, "changed",
+			  G_CALLBACK (cookie_changed_cb), info->dialog);
 
 	info->scroll_to (info);
 }
@@ -1092,7 +1074,7 @@
 pdm_dialog_cookie_add (PdmActionInfo *info,
 		       gpointer data)
 {
-	EphyCookie *cookie = (EphyCookie *) data;
+	SoupCookie *cookie = (SoupCookie *) data;
 	GtkListStore *store;
 	GtkTreeIter iter;
 	int column[4] = { COL_COOKIES_HOST, COL_COOKIES_HOST_KEY, COL_COOKIES_NAME, COL_COOKIES_DATA };
@@ -1109,7 +1091,7 @@
 	g_value_init (&value[0], G_TYPE_STRING);
 	g_value_init (&value[1], G_TYPE_STRING);
 	g_value_init (&value[2], G_TYPE_STRING);
-	g_value_init (&value[3], EPHY_TYPE_COOKIE);
+	g_value_init (&value[3], SOUP_TYPE_COOKIE);
 
 	g_value_set_static_string (&value[0], cookie->domain);
 	g_value_take_string (&value[1], ephy_string_collate_key_for_domain (cookie->domain, -1));
@@ -1130,13 +1112,12 @@
 pdm_dialog_cookie_remove (PdmActionInfo *info,
 			  gpointer data)
 {
-	EphyCookie *cookie = (EphyCookie *) data;
-	EphyCookieManager *manager;
+	SoupCookie *cookie = (SoupCookie *) data;
+	SoupCookieJar *jar;
 
-	manager = EPHY_COOKIE_MANAGER (ephy_embed_shell_get_embed_single
-			(EPHY_EMBED_SHELL (ephy_shell)));
+	jar = get_cookie_jar();
 
-	ephy_cookie_manager_remove_cookie (manager, cookie);
+	soup_cookie_jar_delete_cookie (jar, cookie);
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]