aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-embed-shell.c
diff options
context:
space:
mode:
authorCarlos Garcia Campos <cgarcia@igalia.com>2012-12-29 00:39:40 +0800
committerCarlos Garcia Campos <carlosgc@gnome.org>2013-02-19 19:59:33 +0800
commit86615e3298fa53736a6a2b722be7d45ecffd36db (patch)
tree56a041705b541760e4c04c7a4d7137f790b64d05 /embed/ephy-embed-shell.c
parent8acf5ae0ecaf38ce2b0e1529d88a8fde9803b7e4 (diff)
downloadgsoc2013-epiphany-86615e3298fa53736a6a2b722be7d45ecffd36db.tar
gsoc2013-epiphany-86615e3298fa53736a6a2b722be7d45ecffd36db.tar.gz
gsoc2013-epiphany-86615e3298fa53736a6a2b722be7d45ecffd36db.tar.bz2
gsoc2013-epiphany-86615e3298fa53736a6a2b722be7d45ecffd36db.tar.lz
gsoc2013-epiphany-86615e3298fa53736a6a2b722be7d45ecffd36db.tar.xz
gsoc2013-epiphany-86615e3298fa53736a6a2b722be7d45ecffd36db.tar.zst
gsoc2013-epiphany-86615e3298fa53736a6a2b722be7d45ecffd36db.zip
embed: Implement unsubmitted modified forms warning in WebKit2
Installing a web extension to access the DOM. https://bugzilla.gnome.org/show_bug.cgi?id=684437
Diffstat (limited to 'embed/ephy-embed-shell.c')
-rw-r--r--embed/ephy-embed-shell.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index b4366b2f4..7f48f7c2e 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -33,6 +33,9 @@
#include "ephy-history-service.h"
#include "ephy-profile-utils.h"
#include "ephy-snapshot-service.h"
+#ifdef HAVE_WEBKIT2
+#include "ephy-web-extension.h"
+#endif
#include <glib/gi18n.h>
#include <gtk/gtk.h>
@@ -55,6 +58,9 @@ struct _EphyEmbedShellPrivate
EphyEmbedShellMode mode;
EphyFrecentStore *frecent_store;
guint single_initialised : 1;
+#ifdef HAVE_WEBKIT2
+ GDBusProxy *web_extension;
+#endif
};
enum
@@ -93,6 +99,9 @@ ephy_embed_shell_dispose (GObject *object)
g_clear_object (&priv->global_history_service);
g_clear_object (&priv->embed_single);
g_clear_object (&priv->adblock_manager);
+#ifdef HAVE_WEBKIT2
+ g_clear_object (&priv->web_extension);
+#endif
G_OBJECT_CLASS (ephy_embed_shell_parent_class)->dispose (object);
}
@@ -677,3 +686,27 @@ ephy_embed_shell_launch_handler (EphyEmbedShell *shell,
return ret;
}
+
+#ifdef HAVE_WEBKIT2
+GDBusProxy *
+ephy_embed_shell_get_web_extension_proxy (EphyEmbedShell *shell)
+{
+ EphyEmbedShellPrivate *priv;
+
+ g_return_val_if_fail (EPHY_IS_EMBED_SHELL (shell), NULL);
+
+ priv = shell->priv;
+ if (!priv->web_extension) {
+ priv->web_extension = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
+ G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
+ NULL,
+ EPHY_WEB_EXTENSION_SERVICE_NAME,
+ EPHY_WEB_EXTENSION_OBJECT_PATH,
+ EPHY_WEB_EXTENSION_INTERFACE,
+ NULL,
+ NULL);
+ }
+
+ return priv->web_extension;
+}
+#endif