Index: src/window-commands.c
===================================================================
--- src/window-commands.c	(revision 7227)
+++ src/window-commands.c	(working copy)
@@ -300,7 +300,24 @@ window_cmd_file_save_as (GtkAction *acti
 
 	ephy_embed_persist_save (persist);
 
-	g_object_unref (G_OBJECT(persist));
+	g_object_unref (G_OBJECT (persist));
+}
+
+void
+window_cmd_file_private_mode (GtkAction *action,
+			      EphyWindow *window)
+{
+	EphyHistory *history;
+	gboolean enabled;
+
+	history = EPHY_HISTORY 
+		(ephy_embed_shell_get_global_history (embed_shell));
+
+	enabled = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+	ephy_history_set_enabled (history, !enabled);
+
+	/* FIXME: Also start putting cookies somewhere else (so we 
+	 * still accept them but however we don't save them in the profile */
 }
 
 void
Index: src/window-commands.h
===================================================================
--- src/window-commands.h	(revision 7227)
+++ src/window-commands.h	(working copy)
@@ -67,6 +67,9 @@ void window_cmd_file_print	(GtkAction *a
 void window_cmd_file_send_to	(GtkAction *action,
 				 EphyWindow *window);
 
+void window_cmd_file_private_mode (GtkAction *action,
+				   EphyWindow *window);
+
 void window_cmd_file_work_offline (GtkAction *action,
 				   EphyWindow *window);
 
Index: src/ephy-window.c
===================================================================
--- src/ephy-window.c	(revision 7227)
+++ src/ephy-window.c	(working copy)
@@ -271,6 +271,9 @@ static const GtkToggleActionEntry ephy_m
 {
 	/* File Menu */
 
+	{ "FilePrivateMode", NULL, N_("_Porn mode"), NULL,
+	  N_("Switch to private browsing mode"),
+	  G_CALLBACK (window_cmd_file_private_mode), FALSE },
 	{ "FileWorkOffline", NULL, N_("_Work Offline"), NULL,
 	  N_("Switch to offline mode"),
 	  G_CALLBACK (window_cmd_file_work_offline), FALSE },
Index: data/ui/epiphany-ui.xml
===================================================================
--- data/ui/epiphany-ui.xml	(revision 7227)
+++ data/ui/epiphany-ui.xml	(working copy)
@@ -13,6 +13,7 @@
 			<menuitem name="FileSendToMenu" action="FileSendTo"/>
 			<separator name="FileSep3"/>
 			<menuitem name="FileWorkOfflineItem" action="FileWorkOffline"/>
+			<menuitem name="FilePrivateModeItem" action="FilePrivateMode"/>
 			<menuitem name="FileCloseWindowMenu" action="FileCloseTab"/>
 		</menu>
 
Index: embed/ephy-history.c
===================================================================
--- embed/ephy-history.c	(revision 7233)
+++ embed/ephy-history.c	(working copy)
@@ -125,22 +125,6 @@ ephy_history_get_type (void)
 }
 
 static void
-ephy_history_set_enabled (EphyHistory *history,
-			  gboolean enabled)
-{
-	LOG ("ephy_history_set_enabled %d", enabled);
-
-	history->priv->enabled = enabled;
-
-	ephy_node_db_set_immutable (history->priv->db, !enabled);
-
-	if (enabled == FALSE)
-	{
-		ephy_history_clear (history);
-	}
-}
-
-static void
 ephy_history_set_property (GObject *object,
 			   guint prop_id,
 			   const GValue *value,
@@ -169,7 +153,7 @@ ephy_history_get_property (GObject *obje
 		case PROP_ENABLED:
 			g_value_set_boolean (value, history->priv->enabled);
 			break;
-		}
+	}
 }
 
 static void
@@ -288,7 +272,7 @@ ephy_history_save (EphyHistory *eb)
 	int ret;
 
 	/* only save if there are changes */
-	if (eb->priv->dirty == FALSE)
+	if (eb->priv->dirty == FALSE && eb->priv->enabled)
 	{
 		return;
 	}
@@ -1031,3 +1015,33 @@ ephy_history_is_enabled (EphyHistory *hi
 
 	return history->priv->enabled;
 }
+
+void
+ephy_history_set_enabled (EphyHistory *history,
+			  gboolean enabled)
+{
+	int ret;
+
+	LOG ("ephy_history_set_enabled %d", enabled);
+
+	ret = ephy_node_db_write_to_xml_safe
+		(history->priv->db, (const xmlChar *)history->priv->xml_file,
+		 EPHY_HISTORY_XML_ROOT,
+		 EPHY_HISTORY_XML_VERSION,
+		 NULL, /* comment */
+		 history->priv->hosts,
+		 (EphyNodeFilterFunc) save_filter, history->priv->pages,
+		 history->priv->pages, NULL, NULL,
+		 NULL);
+
+	if (ret >=0)
+	{
+		/* save was successful */
+		history->priv->dirty = FALSE;
+	}
+
+	history->priv->enabled = enabled;
+
+	ephy_node_db_set_immutable (history->priv->db, !enabled);
+}
+
Index: embed/ephy-history.h
===================================================================
--- embed/ephy-history.h	(revision 7227)
+++ embed/ephy-history.h	(working copy)
@@ -120,6 +120,9 @@ void            ephy_history_clear      
 
 gboolean	ephy_history_is_enabled		(EphyHistory *history);
 
+void		ephy_history_set_enabled	(EphyHistory *history,
+						 gboolean enabled);
+
 G_END_DECLS
 
 #endif
