diff options
author | Xan Lopez <xan@gnome.org> | 2009-12-26 00:03:09 +0800 |
---|---|---|
committer | Xan Lopez <xan@gnome.org> | 2009-12-26 00:03:09 +0800 |
commit | 0b844bedb99264ae3699fb6a6aafa5e716b8c5ac (patch) | |
tree | 4a87b4fb6c3335703dc44a92626f3c5a16aa152c /embed/ephy-web-view.c | |
parent | 319c95b59b0838a54a1ee8d52c52b47bdd0e4c2b (diff) | |
download | gsoc2013-epiphany-0b844bedb99264ae3699fb6a6aafa5e716b8c5ac.tar.gz gsoc2013-epiphany-0b844bedb99264ae3699fb6a6aafa5e716b8c5ac.tar.zst gsoc2013-epiphany-0b844bedb99264ae3699fb6a6aafa5e716b8c5ac.zip |
Reimplement window.close
We consider all windows opened by the web page without user
intervention as popups, and allow them to be closed in the same way if
the page so requests.
Bug #599009
Diffstat (limited to 'embed/ephy-web-view.c')
-rw-r--r-- | embed/ephy-web-view.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index 1a9ce6439..6b717a061 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -1943,6 +1943,20 @@ load_status_cb (WebKitWebView *web_view, } } +static gboolean +close_web_view_cb (WebKitWebView *web_view, + gpointer user_data) +{ + EphyEmbedContainer *window; + GtkWidget *widget = gtk_widget_get_toplevel (GTK_WIDGET (web_view)); + window = EPHY_EMBED_CONTAINER (widget); + + if (ephy_embed_container_get_is_popup (window)) + gtk_widget_destroy (GTK_WIDGET (window)); + + return TRUE; +} + static void ephy_web_view_init (EphyWebView *web_view) { @@ -1978,6 +1992,10 @@ ephy_web_view_init (EphyWebView *web_view) G_CALLBACK (load_status_cb), NULL); + g_signal_connect (web_view, "close-web-view", + G_CALLBACK (close_web_view_cb), + NULL); + g_signal_connect_object (web_view, "icon-loaded", G_CALLBACK (favicon_cb), web_view, (GConnectFlags)0); |