aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Garcia Campos <cgarcia@igalia.com>2013-03-07 00:57:17 +0800
committerCarlos Garcia Campos <carlosgc@gnome.org>2013-03-07 03:16:54 +0800
commite4884cdab61ed2ddc0c69b51175d41f11cc1ded6 (patch)
tree023ec87c4860a3988b75602fad70d507d90f901e
parent80ea62552d2e08dc2e990c5820678a06157ae416 (diff)
downloadgsoc2013-epiphany-e4884cdab61ed2ddc0c69b51175d41f11cc1ded6.tar
gsoc2013-epiphany-e4884cdab61ed2ddc0c69b51175d41f11cc1ded6.tar.gz
gsoc2013-epiphany-e4884cdab61ed2ddc0c69b51175d41f11cc1ded6.tar.bz2
gsoc2013-epiphany-e4884cdab61ed2ddc0c69b51175d41f11cc1ded6.tar.lz
gsoc2013-epiphany-e4884cdab61ed2ddc0c69b51175d41f11cc1ded6.tar.xz
gsoc2013-epiphany-e4884cdab61ed2ddc0c69b51175d41f11cc1ded6.tar.zst
gsoc2013-epiphany-e4884cdab61ed2ddc0c69b51175d41f11cc1ded6.zip
Do not build adblock files in libephyembed for WebKit2
The required files will be built in the web extension.
-rw-r--r--embed/Makefile.am18
-rw-r--r--embed/ephy-embed-shell.c12
-rw-r--r--embed/ephy-embed.c6
-rw-r--r--src/ephy-shell.c6
4 files changed, 33 insertions, 9 deletions
diff --git a/embed/Makefile.am b/embed/Makefile.am
index 467cc5453..c85988864 100644
--- a/embed/Makefile.am
+++ b/embed/Makefile.am
@@ -13,12 +13,9 @@ NOINST_H_FILES = \
ephy-encoding.h \
ephy-encodings.h \
ephy-file-monitor.h \
- ephy-request-about.h \
- uri-tester.h
+ ephy-request-about.h
INST_H_FILES = \
- ephy-adblock.h \
- ephy-adblock-manager.h \
ephy-download.h \
ephy-embed.h \
ephy-embed-container.h \
@@ -37,8 +34,6 @@ BUILT_SOURCES = \
libephyembed_la_SOURCES = \
ephy-about-handler.c \
- ephy-adblock.c \
- ephy-adblock-manager.c \
ephy-download.c \
ephy-embed.c \
ephy-embed-container.c \
@@ -54,10 +49,19 @@ libephyembed_la_SOURCES = \
ephy-request-about.c \
ephy-embed-prefs.c \
ephy-web-view.c \
- uri-tester.c \
$(INST_H_FILES) \
$(NOINST_H_FILES)
+if !WITH_WEBKIT2
+libephyembed_la_SOURCES += \
+ ephy-adblock.c \
+ ephy-adblock.h \
+ ephy-adblock-manager.c \
+ ephy-adblock-manager.h \
+ uri-tester.c \
+ uri-tester.h
+endif
+
nodist_libephyembed_la_SOURCES = \
$(BUILT_SOURCES)
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index e3140a5a6..fe2969e9b 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -22,7 +22,9 @@
#include <config.h>
#include "ephy-embed-shell.h"
+#ifndef HAVE_WEBKIT2
#include "ephy-adblock-manager.h"
+#endif
#include "ephy-debug.h"
#include "ephy-download.h"
#include "ephy-embed-private.h"
@@ -52,7 +54,9 @@ struct _EphyEmbedShellPrivate
GList *downloads;
EphyEmbedSingle *embed_single;
EphyEncodings *encodings;
+#ifndef HAVE_WEBKIT2
EphyAdBlockManager *adblock_manager;
+#endif
GtkPageSetup *page_setup;
GtkPrintSettings *print_settings;
EphyEmbedShellMode mode;
@@ -99,11 +103,12 @@ ephy_embed_shell_dispose (GObject *object)
g_clear_object (&priv->frecent_store);
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);
if (priv->web_extension_watch_name_id > 0)
g_bus_unwatch_name (priv->web_extension_watch_name_id);
+#else
+ g_clear_object (&priv->adblock_manager);
#endif
G_OBJECT_CLASS (ephy_embed_shell_parent_class)->dispose (object);
@@ -511,6 +516,7 @@ ephy_embed_shell_get_default (void)
GObject *
ephy_embed_shell_get_adblock_manager (EphyEmbedShell *shell)
{
+#ifndef HAVE_WEBKIT2
EphyEmbedShellPrivate *priv;
g_return_val_if_fail (EPHY_IS_EMBED_SHELL (shell), NULL);
@@ -525,6 +531,10 @@ ephy_embed_shell_get_adblock_manager (EphyEmbedShell *shell)
}
return G_OBJECT (priv->adblock_manager);
+#else
+ g_assert_not_reached ();
+ return NULL;
+#endif
}
void
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index 0fdf921fb..e805e077c 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -26,7 +26,9 @@
#include "config.h"
#include "ephy-embed.h"
+#ifndef HAVE_WEBKIT2
#include "ephy-adblock-manager.h"
+#endif
#include "ephy-debug.h"
#include "ephy-download.h"
#include "ephy-embed-prefs.h"
@@ -105,7 +107,9 @@ struct _EphyEmbedPrivate
gulong status_handler_id;
gulong progress_update_handler_id;
+#ifndef HAVE_WEBKIT2
gulong adblock_handler_id;
+#endif
};
enum
@@ -425,10 +429,12 @@ ephy_embed_dispose (GObject *object)
priv->fullscreen_message_id = 0;
}
+#ifndef HAVE_WEBKIT2
if (priv->adblock_handler_id) {
g_signal_handler_disconnect (priv->web_view, priv->adblock_handler_id);
priv->adblock_handler_id = 0;
}
+#endif
g_clear_object (&priv->delayed_request);
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 3f39fe67a..3d8fc523f 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -23,7 +23,9 @@
#include "config.h"
#include "ephy-shell.h"
+#ifndef HAVE_WEBKIT2
#include "ephy-adblock-manager.h"
+#endif
#include "ephy-bookmarks-editor.h"
#include "ephy-bookmarks-import.h"
#include "ephy-debug.h"
@@ -477,9 +479,11 @@ ephy_shell_constructed (GObject *object)
/* FIXME: not sure if this is the best place to put this stuff. */
ephy_shell_get_lockdown (EPHY_SHELL (object));
-
+
+#ifndef HAVE_WEBKIT2
if (ephy_embed_shell_get_mode (EPHY_EMBED_SHELL (object)) != EPHY_EMBED_SHELL_MODE_TEST)
ephy_embed_shell_get_adblock_manager (EPHY_EMBED_SHELL (object));
+#endif
if (G_OBJECT_CLASS (ephy_shell_parent_class)->constructed)
G_OBJECT_CLASS (ephy_shell_parent_class)->constructed (object);