From 6da63a35ffe4254084c80d5abb568f9e9906be5a Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Sat, 9 Mar 2013 21:18:28 +0100 Subject: ephy-embed-shell: add a ::web-view-created signal Emitted every time we create an EphyWebView anywhere. This will be useful in our tests. https://bugzilla.gnome.org/show_bug.cgi?id=695300 --- embed/ephy-embed-shell.c | 19 +++++++++++++++++++ embed/ephy-web-view.c | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'embed') diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c index fe2969e9b..19e543216 100644 --- a/embed/ephy-embed-shell.c +++ b/embed/ephy-embed-shell.c @@ -74,6 +74,7 @@ enum DOWNLOAD_REMOVED, PREPARE_CLOSE, RESTORED_WINDOW, + WEB_VIEW_CREATED, LAST_SIGNAL }; @@ -489,6 +490,24 @@ ephy_embed_shell_class_init (EphyEmbedShellClass *klass) G_TYPE_NONE, 0); + /** + * EphyEmbedShell::web-view-created: + * @shell: the #EphyEmbedShell + * @view: the newly created #EphyWebView + * + * The ::web-view-created signal will be emitted every time a new + * #EphyWebView is created. + * + **/ + signals[WEB_VIEW_CREATED] = + g_signal_new ("web-view-created", + EPHY_TYPE_EMBED_SHELL, + G_SIGNAL_RUN_LAST, + 0, NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + EPHY_TYPE_WEB_VIEW); + g_type_class_add_private (object_class, sizeof (EphyEmbedShellPrivate)); } diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index 67fc4c7c5..4f739f357 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -1284,10 +1284,11 @@ ephy_web_view_constructed (GObject *object) * have both enabled at the same time in WebKit now (although our * API does not reflect this atm). See r67274 in WebKit. */ #ifndef HAVE_WEBKIT2 - /* This is the default behaviour in WebKit2 */ webkit_web_view_set_full_content_zoom (WEBKIT_WEB_VIEW (object), TRUE); #endif + + g_signal_emit_by_name (ephy_embed_shell_get_default (), "web-view-created", object); } static void -- cgit v1.2.3