[epiphany] Bump WebKitGTK+ requirements to 2.5.1



commit 2f6cfb0dfb2400cf0b3f49ba83b548ed01864dea
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Fri Aug 1 14:23:21 2014 +0200

    Bump WebKitGTK+ requirements to 2.5.1
    
    And remove all ifdefs.

 configure.ac                            |    4 ++--
 embed/ephy-embed-prefs.c                |   31 +------------------------------
 embed/ephy-embed-prefs.h                |    2 +-
 embed/ephy-embed-shell.c                |   12 ++----------
 embed/ephy-embed-shell.h                |    4 ++--
 embed/ephy-web-view.c                   |    8 --------
 embed/web-extension/ephy-web-overview.c |    2 --
 src/ephy-window.c                       |    2 --
 8 files changed, 8 insertions(+), 57 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index f9b9e79..025ba73 100644
--- a/configure.ac
+++ b/configure.ac
@@ -69,7 +69,7 @@ GLIB_REQUIRED=2.38.0
 GTK_REQUIRED=3.13.0
 LIBXML_REQUIRED=2.6.12
 LIBXSLT_REQUIRED=1.1.7
-WEBKIT_GTK_REQUIRED=2.4.4
+WEBKIT_GTK_REQUIRED=2.5.1
 LIBSOUP_REQUIRED=2.42.1
 GNOME_DESKTOP_REQUIRED=2.91.2
 LIBSECRET_REQUIRED=0.14
@@ -78,7 +78,7 @@ LIBNOTIFY_REQUIRED=0.5.1
 GCR_REQUIRED=3.5.5
 AVAHI_REQUIRED=0.6.22
 
-WEBKIT_GTK_PC_NAME=webkit2gtk-3.0
+WEBKIT_GTK_PC_NAME=webkit2gtk-4.0
 
 # Tests
 
diff --git a/embed/ephy-embed-prefs.c b/embed/ephy-embed-prefs.c
index 77575fb..d7cd576 100644
--- a/embed/ephy-embed-prefs.c
+++ b/embed/ephy-embed-prefs.c
@@ -43,9 +43,6 @@ typedef struct
 #define ENABLE_SCRIPTS_SETTING "enable-javascript"
 #define DEFAULT_ENCODING_SETTING "default-charset"
 static WebKitSettings *webkit_settings = NULL;
-#if !WEBKIT_CHECK_VERSION(2, 5, 0)
-static WebKitWebViewGroup *web_view_group = NULL;
-#endif
 
 static void
 user_style_sheet_output_stream_splice_cb (GOutputStream *output_stream,
@@ -56,7 +53,6 @@ user_style_sheet_output_stream_splice_cb (GOutputStream *output_stream,
 
   bytes = g_output_stream_splice_finish (output_stream, result, NULL);
   if (bytes > 0) {
-#if WEBKIT_CHECK_VERSION(2, 5, 0)
     WebKitUserStyleSheet *style_sheet;
 
     style_sheet = webkit_user_style_sheet_new (g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM 
(output_stream)),
@@ -65,11 +61,6 @@ user_style_sheet_output_stream_splice_cb (GOutputStream *output_stream,
     webkit_user_content_manager_add_style_sheet (WEBKIT_USER_CONTENT_MANAGER 
(ephy_embed_shell_get_user_content_manager (ephy_embed_shell_get_default ())),
                                                  style_sheet);
     webkit_user_style_sheet_unref (style_sheet);
-#else
-    webkit_web_view_group_add_user_style_sheet (web_view_group,
-                                                g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM 
(output_stream)),
-                                                NULL, NULL, NULL, WEBKIT_INJECTED_CONTENT_FRAMES_ALL);
-#endif
   }
 }
 
@@ -107,11 +98,7 @@ webkit_pref_callback_user_stylesheet (GSettings *settings,
   value = g_settings_get_boolean (settings, key);
 
   if (!value)
-#if WEBKIT_CHECK_VERSION(2, 5, 0)
     webkit_user_content_manager_remove_all_style_sheets (WEBKIT_USER_CONTENT_MANAGER 
(ephy_embed_shell_get_user_content_manager (ephy_embed_shell_get_default ())));
-#else
-    webkit_web_view_group_remove_all_user_style_sheets (web_view_group);
-#endif
   else {
     GFile *file;
     char *filename;
@@ -546,22 +533,11 @@ ephy_embed_prefs_init (gpointer user_data)
 {
   int i;
 
-#if WEBKIT_CHECK_VERSION(2, 5, 0)
   webkit_settings = webkit_settings_new_with_settings ("enable-developer-extras", TRUE,
                                                        "enable-fullscreen", TRUE,
                                                        "enable-site-specific-quirks", TRUE,
                                                        "enable-dns-prefetching", TRUE,
                                                        NULL);
-#else
-  web_view_group = webkit_web_view_group_new ("Ephy WebView Group");
-  webkit_settings = webkit_web_view_group_get_settings (web_view_group);
-  g_object_set (webkit_settings,
-                "enable-developer-extras", TRUE,
-                "enable-fullscreen", TRUE,
-                "enable-site-specific-quirks", TRUE,
-                "enable-dns-prefetching", TRUE,
-                NULL);
-#endif
 
   for (i = 0; i < G_N_ELEMENTS (webkit_pref_entries); i++) {
     GSettings *settings;
@@ -616,15 +592,10 @@ ephy_embed_prefs_init (gpointer user_data)
                    EPHY_PREFS_ENABLE_SMOOTH_SCROLLING,
                    webkit_settings, "enable-smooth-scrolling",
                    G_SETTINGS_BIND_GET);
-#if WEBKIT_CHECK_VERSION(2, 5, 0)
   return webkit_settings;
-#else
-  return web_view_group;
-#endif
 }
 
-/* FIXME: Use WebKitSettings * when we bump WebKitGTK requirements */
-GObject *
+WebKitSettings *
 ephy_embed_prefs_get_settings (void)
 {
   static GOnce once_init = G_ONCE_INIT;
diff --git a/embed/ephy-embed-prefs.h b/embed/ephy-embed-prefs.h
index 037d905..12685e5 100644
--- a/embed/ephy-embed-prefs.h
+++ b/embed/ephy-embed-prefs.h
@@ -34,7 +34,7 @@
 
 G_BEGIN_DECLS
 
-GObject *ephy_embed_prefs_get_settings (void);
+WebKitSettings *ephy_embed_prefs_get_settings (void);
 void ephy_embed_prefs_set_cookie_accept_policy          (WebKitCookieManager *cookie_manager,
                                                          const char          *settings_policy);
 
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index f4e9e5d..4037c00 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -54,9 +54,7 @@ struct _EphyEmbedShellPrivate
   GtkPageSetup *page_setup;
   GtkPrintSettings *print_settings;
   EphyEmbedShellMode mode;
-#if WEBKIT_CHECK_VERSION(2, 5, 0)
   WebKitUserContentManager *user_content;
-#endif
   EphyAboutHandler *about_handler;
   guint update_overview_timeout_id;
   guint hiding_overview_item;
@@ -107,9 +105,7 @@ ephy_embed_shell_dispose (GObject *object)
   g_clear_object (&priv->print_settings);
   g_clear_object (&priv->global_history_service);
   g_clear_object (&priv->about_handler);
-#if WEBKIT_CHECK_VERSION(2, 5, 0)
   g_clear_object (&priv->user_content);
-#endif
 
   G_OBJECT_CLASS (ephy_embed_shell_parent_class)->dispose (object);
 }
@@ -1005,15 +1001,11 @@ ephy_embed_shell_clear_cache (EphyEmbedShell *shell)
   webkit_web_context_clear_cache (webkit_web_context_get_default ());
 }
 
-GObject *
+WebKitUserContentManager *
 ephy_embed_shell_get_user_content_manager (EphyEmbedShell *shell)
 {
-#if WEBKIT_CHECK_VERSION(2, 5, 0)
   if (!shell->priv->user_content)
     shell->priv->user_content = webkit_user_content_manager_new ();
 
-  return G_OBJECT (shell->priv->user_content);
-#else
-  return NULL;
-#endif
+  return shell->priv->user_content;
 }
diff --git a/embed/ephy-embed-shell.h b/embed/ephy-embed-shell.h
index 64653e1..e536c61 100644
--- a/embed/ephy-embed-shell.h
+++ b/embed/ephy-embed-shell.h
@@ -26,7 +26,7 @@
 #ifndef EPHY_EMBED_SHELL_H
 #define EPHY_EMBED_SHELL_H
 
-#include <gtk/gtk.h>
+#include <webkit2/webkit2.h>
 
 G_BEGIN_DECLS
 
@@ -93,7 +93,7 @@ void               ephy_embed_shell_set_thumbanil_path         (EphyEmbedShell
                                                                 const char       *url,
                                                                 time_t            mtime,
                                                                 const char       *path);
-GObject *ephy_embed_shell_get_user_content_manager (EphyEmbedShell *shell);
+WebKitUserContentManager *ephy_embed_shell_get_user_content_manager (EphyEmbedShell *shell);
 
 G_END_DECLS
 
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index d74e649..62eaa18 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -1990,12 +1990,8 @@ GtkWidget *
 ephy_web_view_new (void)
 {
   return g_object_new (EPHY_TYPE_WEB_VIEW,
-#if WEBKIT_CHECK_VERSION(2, 5, 0)
                        "user-content-manager", ephy_embed_shell_get_user_content_manager 
(ephy_embed_shell_get_default ()),
                        "settings", ephy_embed_prefs_get_settings (),
-#else
-                       "group", ephy_embed_prefs_get_settings (),
-#endif
                        NULL);
 }
 
@@ -2004,11 +2000,7 @@ ephy_web_view_new_with_related_view (WebKitWebView *related_view)
 {
   return g_object_new (EPHY_TYPE_WEB_VIEW,
                        "related-view", related_view,
-#if WEBKIT_CHECK_VERSION(2, 5, 0)
                        "settings", ephy_embed_prefs_get_settings (),
-#else
-                       "group", ephy_embed_prefs_get_settings (),
-#endif
                        NULL);
 }
 
diff --git a/embed/web-extension/ephy-web-overview.c b/embed/web-extension/ephy-web-overview.c
index 9e9f461..878fb5f 100644
--- a/embed/web-extension/ephy-web-overview.c
+++ b/embed/web-extension/ephy-web-overview.c
@@ -23,11 +23,9 @@
 
 #include <string.h>
 
-#if WEBKIT_CHECK_VERSION(2, 5, 0)
 #define WEBKIT_DOM_USE_UNSTABLE_API
 #include <webkitdom/WebKitDOMElementUnstable.h>
 #include <webkitdom/WebKitDOMDOMTokenList.h>
-#endif
 
 struct _EphyWebOverviewPrivate
 {
diff --git a/src/ephy-window.c b/src/ephy-window.c
index bfad48e..6fa09b8 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -2008,9 +2008,7 @@ web_view_ready_cb (WebKitWebView *web_view,
 
 static WebKitWebView *
 create_web_view_cb (WebKitWebView *web_view,
-#if WEBKIT_CHECK_VERSION(2, 5, 0)
                    WebKitNavigationAction *navigation_action,
-#endif
                    EphyWindow *window)
 {
        EphyEmbed *embed;


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