[epiphany] Do not build adblock files in libephyembed for WebKit2



commit e4884cdab61ed2ddc0c69b51175d41f11cc1ded6
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Wed Mar 6 17:57:17 2013 +0100

    Do not build adblock files in libephyembed for WebKit2
    
    The required files will be built in the web extension.

 embed/Makefile.am        |   18 +++++++++++-------
 embed/ephy-embed-shell.c |   12 +++++++++++-
 embed/ephy-embed.c       |    6 ++++++
 src/ephy-shell.c         |    6 +++++-
 4 files changed, 33 insertions(+), 9 deletions(-)
---
diff --git a/embed/Makefile.am b/embed/Makefile.am
index 467cc54..c859888 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 e3140a5..fe2969e 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 0fdf921..e805e07 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 3f39fe6..3d8fc52 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);


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