[epiphany] Remove the headless mode



commit 480634f1262d6be652746e98e0caaf7d974220bd
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Mon Dec 9 21:05:01 2013 +0100

    Remove the headless mode
    
    We don't need it anymore now that the search provider is in its own
    binary

 src/ephy-main.c    |    6 ------
 src/ephy-session.c |    2 +-
 src/ephy-shell.c   |   30 +++++-------------------------
 src/ephy-shell.h   |    2 --
 4 files changed, 6 insertions(+), 34 deletions(-)
---
diff --git a/src/ephy-main.c b/src/ephy-main.c
index 0347a57..96ac40b 100644
--- a/src/ephy-main.c
+++ b/src/ephy-main.c
@@ -56,7 +56,6 @@ static char *application_to_delete = NULL;
 static gboolean private_instance = FALSE;
 static gboolean incognito_mode = FALSE;
 static gboolean application_mode = FALSE;
-static gboolean headless_mode = FALSE;
 static char *profile_directory = NULL;
 
 static gboolean
@@ -91,8 +90,6 @@ static const GOptionEntry option_entries[] =
     N_("Start an instance in netbank mode"), NULL },
   { "application-mode", 'a', 0, G_OPTION_ARG_NONE, &application_mode,
     N_("Start the browser in application mode"), NULL },
-  { "headless-mode", 0, 0, G_OPTION_ARG_NONE, &headless_mode,
-    N_("Start the application without opening windows"), NULL },
   { "profile", 0, 0, G_OPTION_ARG_STRING, &profile_directory,
     N_("Profile directory to use in the private instance"), N_("DIR") },
   { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_FILENAME_ARRAY, &arguments,
@@ -217,9 +214,6 @@ get_startup_flags (void)
 {
   EphyStartupFlags flags = 0;
 
-  if (headless_mode)
-    return EPHY_STARTUP_OPEN_NOTHING;
-
   if (open_in_new_tab)
     flags |= EPHY_STARTUP_NEW_TAB;
   if (open_in_new_window)
diff --git a/src/ephy-session.c b/src/ephy-session.c
index 3efbc22..3ab0df8 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -1561,7 +1561,7 @@ ephy_session_resume (EphySession *session,
                return;
        }
 
-       g_task_return_boolean (task, FALSE);
+       g_task_return_boolean (task, TRUE);
        g_object_unref (task);
 }
 
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 3be7cf0..4455ebc 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -286,23 +286,7 @@ session_load_cb (GObject *object,
   EphySession *session = EPHY_SESSION (object);
   EphyShell *shell = EPHY_SHELL (user_data);
 
-  if (ephy_session_resume_finish (session, result, NULL))
-    shell->priv->startup_context->startup_flags |= EPHY_STARTUP_RESUMING_SESSION;
-
-  ephy_shell_startup_continue (shell);
-}
-
-static void
-ephy_shell_start_headless (EphyShell *shell)
-{
-  /* A bit of a hack: because we don't pass IS_SERVICE to GApplication
-     (because otherwise we would need a separate launcher binary), we
-     don't get the 10 seconds timeout for the first DBus call.
-     So just hold/release to get the inactivity timeout started instead.
-  */
-
-  g_application_hold (G_APPLICATION (shell));
-  g_application_release (G_APPLICATION (shell));
+  ephy_session_resume_finish (session, result, NULL);
   ephy_shell_startup_continue (shell);
 }
 
@@ -313,18 +297,14 @@ ephy_shell_activate (GApplication *application)
 
   /*
    * We get here on each new instance (remote or not). Autoresume the
-   * session unless we are in application or headless mode and queue the
-   * commands.
+   * session unless we are in application mode and queue the commands.
    */
   if (ephy_embed_shell_get_mode (EPHY_EMBED_SHELL (shell)) != EPHY_EMBED_SHELL_MODE_APPLICATION) {
     EphyShellStartupContext *ctx;
 
     ctx = shell->priv->startup_context;
-    if (ctx->startup_flags != EPHY_STARTUP_OPEN_NOTHING) {
-      ephy_session_resume (ephy_shell_get_session (shell),
-                           ctx->user_time, NULL, session_load_cb, shell);
-    } else
-      ephy_shell_start_headless (shell);
+    ephy_session_resume (ephy_shell_get_session (shell),
+                         ctx->user_time, NULL, session_load_cb, shell);
   } else
     ephy_shell_startup_continue (shell);
 }
@@ -1096,7 +1076,7 @@ open_uris_data_new (EphyShell *shell,
     data->flags |= EPHY_NEW_TAB_IN_NEW_WINDOW;
   } else if (startup_flags & EPHY_STARTUP_NEW_TAB || (new_windows_in_tabs && have_uris)) {
     data->flags |= EPHY_NEW_TAB_IN_EXISTING_WINDOW | EPHY_NEW_TAB_JUMP | EPHY_NEW_TAB_PRESENT_WINDOW | 
EPHY_NEW_TAB_FROM_EXTERNAL;
-  } else if (!have_uris && !(startup_flags & EPHY_STARTUP_RESUMING_SESSION)) {
+  } else if (!have_uris) {
     data->window = NULL;
     data->flags |= EPHY_NEW_TAB_IN_NEW_WINDOW;
   }
diff --git a/src/ephy-shell.h b/src/ephy-shell.h
index 404fcb8..8aa3294 100644
--- a/src/ephy-shell.h
+++ b/src/ephy-shell.h
@@ -109,8 +109,6 @@ typedef enum {
 typedef enum {
   EPHY_STARTUP_NEW_TAB          = 1 << 0,
   EPHY_STARTUP_NEW_WINDOW       = 1 << 1,
-  EPHY_STARTUP_OPEN_NOTHING     = 1 << 2,
-  EPHY_STARTUP_RESUMING_SESSION = 1 << 3,
 } EphyStartupFlags;
 
 typedef struct {


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