aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-shell.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-02-03 03:32:47 +0800
committerChristian Persch <chpe@src.gnome.org>2005-02-03 03:32:47 +0800
commiteea97b9de2d079295ed6bb2454b5fe367d569b70 (patch)
tree4e09503213f659e5925d4928bcad0c5c19569522 /src/ephy-shell.c
parent2bb88affbb80a7556dfe4d5a0fb194fe4b147c4e (diff)
downloadgsoc2013-epiphany-eea97b9de2d079295ed6bb2454b5fe367d569b70.tar
gsoc2013-epiphany-eea97b9de2d079295ed6bb2454b5fe367d569b70.tar.gz
gsoc2013-epiphany-eea97b9de2d079295ed6bb2454b5fe367d569b70.tar.bz2
gsoc2013-epiphany-eea97b9de2d079295ed6bb2454b5fe367d569b70.tar.lz
gsoc2013-epiphany-eea97b9de2d079295ed6bb2454b5fe367d569b70.tar.xz
gsoc2013-epiphany-eea97b9de2d079295ed6bb2454b5fe367d569b70.tar.zst
gsoc2013-epiphany-eea97b9de2d079295ed6bb2454b5fe367d569b70.zip
Add chrome param to ephy_shell_new_tab_full, and use it in
2005-02-02 Christian Persch <chpe@cvs.gnome.org> * src/ephy-automation.c: (impl_ephy_automation_loadUrlWithStartupId): * src/ephy-shell.c: (ephy_shell_new_window_cb), (ephy_shell_new_tab_full), (ephy_shell_new_tab): * src/ephy-shell.h: Add chrome param to ephy_shell_new_tab_full, and use it in ephy_shell_new_window_cb(). Fixes bug #165566.
Diffstat (limited to 'src/ephy-shell.c')
-rw-r--r--src/ephy-shell.c41
1 files changed, 27 insertions, 14 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index dc9647df5..62e6f5692 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -158,26 +158,33 @@ ephy_shell_new_window_cb (EphyEmbedSingle *single,
EphyEmbedChrome chromemask,
EphyShell *shell)
{
+ GtkWidget *parent = NULL;
EphyTab *new_tab;
- EphyWindow *window;
+ EphyNewTabFlags flags = EPHY_NEW_TAB_DONT_SHOW_WINDOW |
+ EPHY_NEW_TAB_APPEND_LAST |
+ EPHY_NEW_TAB_IN_NEW_WINDOW |
+ EPHY_NEW_TAB_JUMP;
LOG ("ephy_shell_new_window_cb tab chrome %d", chromemask);
- /* FIXME in lockdown-fullscreen mode, always add a new tab instead */
-
if (eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_JAVASCRIPT_CHROME))
{
- window = ephy_window_new ();
+ chromemask = EPHY_EMBED_CHROME_ALL;
}
- else
+
+ if (parent_embed != NULL)
{
- window = ephy_window_new_with_chrome (chromemask);
+ /* this will either be a EphyWindow, or the embed itself
+ * (in case it's about to be destroyed, which means it's already
+ * removed from its tab)
+ */
+ parent = gtk_widget_get_toplevel (GTK_WIDGET (parent_embed));
}
- new_tab = ephy_tab_new ();
- gtk_widget_show (GTK_WIDGET (new_tab));
-
- ephy_window_add_tab (window, new_tab, -1, FALSE);
+ new_tab = ephy_shell_new_tab_full
+ (shell,
+ EPHY_IS_WINDOW (parent) ? EPHY_WINDOW (parent) : NULL,
+ NULL, NULL, flags, chromemask, 0);
return ephy_tab_get_embed (new_tab);
}
@@ -649,6 +656,7 @@ load_homepage (EphyEmbed *embed)
* @parent_window: the target #EphyWindow or %NULL
* @previous_tab: the referrer tab or %NULL
* @url: an url to load or %NULL
+ * @chrome: a #EphyEmbedChrome mask to use if creating a new window
* @user_time: a timestamp, or 0
*
* Create a new tab and the parent window when necessary.
@@ -662,6 +670,7 @@ ephy_shell_new_tab_full (EphyShell *shell,
EphyTab *previous_tab,
const char *url,
EphyNewTabFlags flags,
+ EphyEmbedChrome chrome,
guint32 user_time)
{
EphyWindow *window;
@@ -690,7 +699,7 @@ ephy_shell_new_tab_full (EphyShell *shell,
}
else
{
- window = ephy_window_new ();
+ window = ephy_window_new_with_chrome (chrome);
}
toolbar = EPHY_TOOLBAR (ephy_window_get_toolbar (window));
@@ -715,8 +724,6 @@ ephy_shell_new_tab_full (EphyShell *shell,
ephy_gui_window_update_user_time (GTK_WIDGET (window), user_time);
- gtk_widget_show (GTK_WIDGET (window));
-
if (flags & EPHY_NEW_TAB_HOME_PAGE ||
flags & EPHY_NEW_TAB_NEW_PAGE)
{
@@ -730,6 +737,11 @@ ephy_shell_new_tab_full (EphyShell *shell,
ephy_embed_load_url (embed, url);
}
+ if ((flags & EPHY_NEW_TAB_DONT_SHOW_WINDOW) == 0)
+ {
+ gtk_widget_show (GTK_WIDGET (window));
+ }
+
if (flags & EPHY_NEW_TAB_FULLSCREEN_MODE)
{
gtk_window_fullscreen (GTK_WINDOW (window));
@@ -758,7 +770,8 @@ ephy_shell_new_tab (EphyShell *shell,
EphyNewTabFlags flags)
{
return ephy_shell_new_tab_full (shell, parent_window,
- previous_tab, url, flags, 0);
+ previous_tab, url, flags,
+ EPHY_EMBED_CHROME_ALL, 0);
}
/**