Index: embed/webkit/webkit-embed.cpp
===================================================================
--- embed/webkit/webkit-embed.cpp	(revisione 7325)
+++ embed/webkit/webkit-embed.cpp	(copia locale)
@@ -28,6 +28,7 @@
 #include "ephy-embed-event.h"
 
 #include <webkitgtkpage.h>
+#include <webkitgtkframe.h>
 #include <webkitgtkglobal.h>
 #include <string.h>
 
@@ -40,6 +41,11 @@ static void	webkit_embed_destroy		(GtkOb
 static void	webkit_embed_finalize		(GObject *object);
 static void	ephy_embed_iface_init		(EphyEmbedIface *iface);
 
+static void	webkit_embed_title_changed_cb (WebKitGtkFrame *frame,
+					       gchar *title,
+					       gchar *location,
+					       EphyEmbed *embed);
+
 #if 0
 static void    load_started_cb                 (WebKitGtkPage *page,
                                                WebKitGtkFrame *frame,
@@ -136,6 +142,15 @@ webkit_embed_class_init (WebKitEmbedClas
   widget_class->grab_focus = webkit_embed_grab_focus;
 
   g_type_class_add_private (object_class, sizeof(WebKitEmbedPrivate));
+
+  g_signal_new ("title",
+                WEBKIT_TYPE_EMBED,
+                (GSignalFlags) (G_SIGNAL_RUN_FIRST | G_SIGNAL_RUN_LAST),
+                0,
+                NULL, NULL,
+                g_cclosure_marshal_VOID__VOID,
+                G_TYPE_NONE,
+                0);
 }
 
 static void
@@ -155,6 +170,9 @@ webkit_embed_init (WebKitEmbed *embed)
   embed->priv->page = page;
   gtk_container_add (GTK_CONTAINER (embed), GTK_WIDGET (page));
   gtk_widget_show (GTK_WIDGET (page));
+    
+  g_signal_connect (G_OBJECT (page), "title-changed",
+                    G_CALLBACK (webkit_embed_title_changed_cb), embed);
 
 #if 0
   g_signal_connect (G_OBJECT (page), "load-started",
@@ -167,6 +185,18 @@ webkit_embed_init (WebKitEmbed *embed)
 }
 
 static void
+webkit_embed_title_changed_cb (WebKitGtkFrame *frame, gchar *title, gchar *location, EphyEmbed *embed)
+{
+  /* We emit ge-location signal here, but it should really belong
+   * to a "location_changed" signal by WebKit, as we can change title
+   * without changing location or change location without changing title
+   */
+
+  g_signal_emit_by_name (embed, "ge-location", location);
+  g_signal_emit_by_name (embed, "title", NULL);
+}
+
+static void
 webkit_embed_destroy (GtkObject *object)
 {
   GTK_OBJECT_CLASS (webkit_embed_parent_class)->destroy (object);
@@ -264,7 +294,9 @@ impl_go_up (EphyEmbed *embed)
 static char *
 impl_get_title (EphyEmbed *embed)
 {
-  return NULL;
+  WebKitGtkFrame *frame = webkit_gtk_page_get_main_frame (WEBKIT_EMBED (embed)->priv->page);
+  gchar *title = webkit_gtk_frame_get_title (frame);
+  return g_strdup (title);
 }
 
 static char *
@@ -283,7 +315,9 @@ static char *
 impl_get_location (EphyEmbed *embed, 
                    gboolean toplevel)
 {
-  return NULL;
+  WebKitGtkFrame *frame = webkit_gtk_page_get_main_frame (WEBKIT_EMBED (embed)->priv->page);
+  gchar *location = webkit_gtk_frame_get_location (frame);
+  return g_strdup (location);
 }
 
 static void
