Index: src/ephy-window.c
===================================================================
--- src/ephy-window.c	(revision 6768)
+++ src/ephy-window.c	(working copy)
@@ -1446,6 +1446,26 @@ sync_tab_load_progress (EphyTab *tab, GP
 }
 
 static void
+tab_location (EphyTab *tab, char *location, EphyWindow *window)
+{	
+	EphyBookmarks *bookmarks;
+	EphyNode *node;
+	
+	return;
+	
+	bookmarks = ephy_shell_get_bookmarks (ephy_shell);
+	
+	node = ephy_bookmarks_find_bookmark (bookmarks, location);
+	if (node != NULL)
+	{
+	g_print ("%s\n", location);
+		ephy_toolbar_set_security_state (window->priv->toolbar, TRUE,
+					 TRUE, STOCK_BOOKMARK, location);
+	}
+	
+}
+
+static void
 sync_tab_message (EphyTab *tab, GParamSpec *pspec, EphyWindow *window)
 {
 	GtkStatusbar *s = GTK_STATUSBAR (window->priv->statusbar);
@@ -1568,6 +1588,32 @@ sync_tab_security (EphyTab *tab,
 
 	ephy_toolbar_set_security_state (priv->toolbar, is_secure,
 					 show_lock, stock_id, tooltip);
+	
+	/* Put here to avoid fighting with this function for precedence */
+	if (!show_lock)
+	{
+		EphyBookmarks *bookmarks;
+		EphyNode *node;
+		char *location;
+		
+		location = ephy_embed_get_location (embed, TRUE);
+		
+		if (location != NULL)
+		{
+			bookmarks = ephy_shell_get_bookmarks (ephy_shell);
+			
+			node = ephy_bookmarks_find_bookmark (bookmarks, location);
+			if (node != NULL)
+			{
+				const char *title = ephy_node_get_property_string (node,
+                                                EPHY_NODE_BMK_PROP_TITLE);
+				ephy_toolbar_set_security_state (window->priv->toolbar, is_secure,
+							 TRUE, STOCK_BOOKMARK, title);
+			}
+		}
+		
+		g_free (location);
+	}
 
 	if (priv->fullscreen_popup != NULL)
 	{
@@ -2248,6 +2294,9 @@ ephy_window_set_active_tab (EphyWindow *
 		g_signal_connect_object (embed, "size-to",
 					 G_CALLBACK (tab_size_to_cb),
 					 window, 0);
+		g_signal_connect_object (embed, "ge-location",
+					 G_CALLBACK (tab_location),
+					 window, 0);
 
 		g_object_notify (G_OBJECT (window), "active-tab");
 	}
