diff options
author | Diego Escalante Urrelo <diegoe@src.gnome.org> | 2008-12-03 09:34:13 +0800 |
---|---|---|
committer | Diego Escalante Urrelo <diegoe@src.gnome.org> | 2008-12-03 09:34:13 +0800 |
commit | 96e097ef0c93c7a1037f3141efeeaf301fc3c265 (patch) | |
tree | d3f74c0384210b9e3e1eb2cddda9000369a5e056 /src | |
parent | 0ed3933fdf105e7b9ecfd384190f155b225d3630 (diff) | |
download | gsoc2013-epiphany-96e097ef0c93c7a1037f3141efeeaf301fc3c265.tar gsoc2013-epiphany-96e097ef0c93c7a1037f3141efeeaf301fc3c265.tar.gz gsoc2013-epiphany-96e097ef0c93c7a1037f3141efeeaf301fc3c265.tar.bz2 gsoc2013-epiphany-96e097ef0c93c7a1037f3141efeeaf301fc3c265.tar.lz gsoc2013-epiphany-96e097ef0c93c7a1037f3141efeeaf301fc3c265.tar.xz gsoc2013-epiphany-96e097ef0c93c7a1037f3141efeeaf301fc3c265.tar.zst gsoc2013-epiphany-96e097ef0c93c7a1037f3141efeeaf301fc3c265.zip |
Implement chrome visibility control in popups
Fixes bug #562714. Fullscreen, scrollbar and location bar left out for
security/usability. Location bar might be enabled later with something
ala-firefox.
svn path=/trunk/; revision=8629
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-window.c | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c index f5211c2e7..98696ad09 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -2412,19 +2412,47 @@ web_view_ready_cb (WebKitWebView *web_view, EphyEmbed *embed) { WebKitWebWindowFeatures *features; - GtkWidget *window; + EphyWindow *window; int width, height; - window = gtk_widget_get_toplevel (GTK_WIDGET (web_view)); + gboolean toolbar_visible; + gboolean statusbar_visible; + gboolean menubar_visible; + + EphyEmbedChrome chrome_mask; + + toolbar_visible = statusbar_visible = menubar_visible = TRUE; + + window = EPHY_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (web_view))); features = webkit_web_view_get_window_features (web_view); - /* FIXME: apply all features when appropriate */ + + chrome_mask = window->priv->chrome; + g_object_get (features, "width", &width, "height", &height, + "toolbar-visible", &toolbar_visible, + "statusbar-visible", &statusbar_visible, + "menubar-visible", &menubar_visible, NULL); gtk_window_set_default_size (GTK_WINDOW (window), width, height); - gtk_widget_show (window); + + if (!toolbar_visible) + chrome_mask &= ~EPHY_EMBED_CHROME_TOOLBAR; + + if (!statusbar_visible) + chrome_mask &= ~EPHY_EMBED_CHROME_STATUSBAR; + + if (!menubar_visible) + chrome_mask &= ~EPHY_EMBED_CHROME_MENUBAR; + + window->priv->chrome = chrome_mask; + + update_chromes_actions (window); + sync_chromes_visibility (window); + + gtk_widget_show (GTK_WIDGET (window)); return TRUE; } |