[epiphany] Always use the EphyEmbedShell to know if we are a private instance



commit 5b3154f5ddb95f162389340b178d6fc51b3a3bd7
Author: Xan Lopez <xlopez igalia com>
Date:   Wed Jun 29 20:03:40 2011 +0200

    Always use the EphyEmbedShell to know if we are a private instance
    
    We can now get rid of the EphyFileHelpers method.

 embed/ephy-embed-single.c |    2 +-
 embed/ephy-web-view.c     |    2 +-
 lib/ephy-file-helpers.c   |   15 ---------------
 lib/ephy-file-helpers.h   |    1 -
 src/pdm-dialog.c          |    2 +-
 5 files changed, 3 insertions(+), 19 deletions(-)
---
diff --git a/embed/ephy-embed-single.c b/embed/ephy-embed-single.c
index b9787fd..a41d0b2 100644
--- a/embed/ephy-embed-single.c
+++ b/embed/ephy-embed-single.c
@@ -528,7 +528,7 @@ ephy_embed_single_initialize (EphyEmbedSingle *single)
      are not using a private session, otherwise we want any new
      password to expire when we exit *and* we don't want to use any
      existing password in the keyring */
-  if (ephy_has_private_profile () == FALSE)
+  if (ephy_embed_shell_is_private_instance (ephy_embed_shell_get_default ()) == FALSE)
     soup_session_add_feature_by_type (session, SOUP_TYPE_PASSWORD_MANAGER_GNOME);
 #endif
 
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 015a323..719db10 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -1873,7 +1873,7 @@ load_status_cb (WebKitWebView *web_view,
     if (ephy_web_view_get_is_blank (view))
       g_object_notify (object, "embed-title");
 
-    if (ephy_has_private_profile () == FALSE &&
+    if (ephy_embed_shell_is_private_instance (embed_shell) == FALSE &&
         g_settings_get_boolean (EPHY_SETTINGS_MAIN,
                                 EPHY_PREFS_REMEMBER_PASSWORDS))
       _ephy_web_view_hook_into_forms (view);
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c
index 64ea917..d996c21 100644
--- a/lib/ephy-file-helpers.c
+++ b/lib/ephy-file-helpers.c
@@ -62,7 +62,6 @@
 static GHashTable *files = NULL;
 static GHashTable *mime_table = NULL;
 
-static gboolean have_private_profile = FALSE;
 static gboolean keep_temp_directory = FALSE; /* for debug purposes */
 static char *dot_dir = NULL;
 static char *tmp_dir = NULL;
@@ -274,19 +273,6 @@ ephy_dot_dir (void)
 }
 
 /**
- * ephy_has_private_profile:
- *
- * Whether Epiphany is running with a private profile (-p command line option).
- *
- * Returns: %TRUE if a private profile is in use
- **/
-gboolean
-ephy_has_private_profile (void)
-{
-	return have_private_profile;
-}
-
-/**
  * ephy_file_helpers_init:
  * @profile_dir: directory to use as Epiphany's profile
  * @private_profile: %TRUE if we should use a private profile
@@ -324,7 +310,6 @@ ephy_file_helpers_init (const char *profile_dir,
 				       (GDestroyNotify) g_free,
 				       (GDestroyNotify) g_free);
 
-	have_private_profile = private_profile;
 	keep_temp_directory = keep_temp_dir;
 
 	if (private_profile && profile_dir != NULL)
diff --git a/lib/ephy-file-helpers.h b/lib/ephy-file-helpers.h
index 095f713..83d9198 100644
--- a/lib/ephy-file-helpers.h
+++ b/lib/ephy-file-helpers.h
@@ -83,7 +83,6 @@ gboolean           ephy_file_browse_to           (GFile       *file,
                                                   guint32      user_time);
 void               ephy_file_delete_directory    (const char  *path);
 void               ephy_file_delete_uri          (const char  *uri);
-gboolean           ephy_has_private_profile      (void);
 void               ephy_file_load_accels (void);
 void               ephy_file_save_accels (void);
 
diff --git a/src/pdm-dialog.c b/src/pdm-dialog.c
index 54d36d1..f5ce73f 100644
--- a/src/pdm-dialog.c
+++ b/src/pdm-dialog.c
@@ -1518,7 +1518,7 @@ pdm_dialog_init (PdmDialog *dialog)
 	PdmDialogPrivate *priv;
 	PdmActionInfo *cookies, *passwords;
 	GtkWidget *window;
-	gboolean has_private_profile = ephy_has_private_profile ();
+	gboolean has_private_profile = ephy_embed_shell_is_private_instance (embed_shell);
 
 
 	priv = dialog->priv = EPHY_PDM_DIALOG_GET_PRIVATE (dialog);



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