[epiphany] Add a new mode for shell testing, EPHY_EMBED_SHELL_MODE_TEST
- From: Xan Lopez <xan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Add a new mode for shell testing, EPHY_EMBED_SHELL_MODE_TEST
- Date: Thu, 14 Jun 2012 06:47:22 +0000 (UTC)
commit 4873a591b6e90a6df99e7d0965c93b74bf4fec85
Author: Xan Lopez <xan igalia com>
Date: Thu Jun 14 07:32:26 2012 +0200
Add a new mode for shell testing, EPHY_EMBED_SHELL_MODE_TEST
For now the only difference is that no top-level window will be shown
in this mode, but in the future it can be extended to behave in a
manner appropriate for testing.
embed/ephy-embed-shell.h | 3 ++-
src/ephy-session.c | 9 ++++++---
src/ephy-shell.c | 3 ++-
3 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/embed/ephy-embed-shell.h b/embed/ephy-embed-shell.h
index 97ec38a..8f4717b 100644
--- a/embed/ephy-embed-shell.h
+++ b/embed/ephy-embed-shell.h
@@ -51,7 +51,8 @@ typedef enum
{
EPHY_EMBED_SHELL_MODE_BROWSER,
EPHY_EMBED_SHELL_MODE_PRIVATE,
- EPHY_EMBED_SHELL_MODE_APPLICATION
+ EPHY_EMBED_SHELL_MODE_APPLICATION,
+ EPHY_EMBED_SHELL_MODE_TEST
} EphyEmbedShellMode;
struct _EphyEmbedShell
diff --git a/src/ephy-session.c b/src/ephy-session.c
index 642ba68..70af83c 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -1142,9 +1142,12 @@ ephy_session_load_from_string (EphySession *session,
}
}
- active_child = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
- gtk_widget_grab_focus (GTK_WIDGET (active_child));
- gtk_widget_show (widget);
+ if (ephy_embed_shell_get_mode (embed_shell) != EPHY_EMBED_SHELL_MODE_TEST)
+ {
+ active_child = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
+ gtk_widget_grab_focus (GTK_WIDGET (active_child));
+ gtk_widget_show (widget);
+ }
}
else if (xmlStrEqual (child->name, (const xmlChar *) "toolwindow"))
{
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index b2510a4..35325b8 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -746,7 +746,8 @@ ephy_shell_new_tab_full (EphyShell *shell,
ephy_gui_window_update_user_time (GTK_WIDGET (window), user_time);
- if ((flags & EPHY_NEW_TAB_DONT_SHOW_WINDOW) == 0) {
+ if ((flags & EPHY_NEW_TAB_DONT_SHOW_WINDOW) == 0 &&
+ ephy_embed_shell_get_mode (embed_shell) != EPHY_EMBED_SHELL_MODE_TEST) {
gtk_widget_show (GTK_WIDGET (window));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]