epiphany r8629 - trunk/src



Author: diegoe
Date: Wed Dec  3 01:34:13 2008
New Revision: 8629
URL: http://svn.gnome.org/viewvc/epiphany?rev=8629&view=rev

Log:
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.

Modified:
   trunk/src/ephy-window.c

Modified: trunk/src/ephy-window.c
==============================================================================
--- trunk/src/ephy-window.c	(original)
+++ trunk/src/ephy-window.c	Wed Dec  3 01:34:13 2008
@@ -2412,19 +2412,47 @@
 		   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;
 }



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