[epiphany] Remove EphyPermissionManager



commit c410e9d9683b3b7b8da7f92adcaf8332e900caad
Author: Xan Lopez <xan igalia com>
Date:   Thu Feb 14 18:55:15 2013 +0100

    Remove EphyPermissionManager
    
    This was also a no-op. The only thing the popup code is doing is
    checking the GSetting, so just do that.

 embed/Makefile.am               |    2 -
 embed/ephy-embed-single.c       |   55 +--------
 embed/ephy-permission-manager.c |  284 ---------------------------------------
 embed/ephy-permission-manager.h |  132 ------------------
 embed/ephy-web-view.c           |   47 +------
 src/epiphany.h.in               |    1 -
 6 files changed, 3 insertions(+), 518 deletions(-)
---
diff --git a/embed/Makefile.am b/embed/Makefile.am
index 3e44814..3efa9ed 100644
--- a/embed/Makefile.am
+++ b/embed/Makefile.am
@@ -29,7 +29,6 @@ INST_H_FILES = \
        ephy-embed-shell.h              \
        ephy-embed-utils.h              \
        ephy-overview.h                 \
-       ephy-permission-manager.h       \
        ephy-web-view.h
 
 
@@ -53,7 +52,6 @@ libephyembed_la_SOURCES = \
        ephy-encodings.c                \
        ephy-file-monitor.c             \
        ephy-overview.c                 \
-       ephy-permission-manager.c       \
        ephy-request-about.c            \
        ephy-embed-prefs.c              \
        ephy-web-view.c                 \
diff --git a/embed/ephy-embed-single.c b/embed/ephy-embed-single.c
index 190beae..35e57b9 100644
--- a/embed/ephy-embed-single.c
+++ b/embed/ephy-embed-single.c
@@ -27,7 +27,6 @@
 #include "ephy-embed-shell.h"
 #include "ephy-embed-type-builtins.h"
 #include "ephy-file-helpers.h"
-#include "ephy-permission-manager.h"
 #include "ephy-prefs.h"
 #include "ephy-profile-utils.h"
 #include "ephy-request-about.h"
@@ -54,11 +53,7 @@ struct _EphyEmbedSinglePrivate {
 #endif
 };
 
-static void ephy_permission_manager_iface_init (EphyPermissionManagerIface *iface);
-
-G_DEFINE_TYPE_WITH_CODE (EphyEmbedSingle, ephy_embed_single, G_TYPE_OBJECT,
-                         G_IMPLEMENT_INTERFACE (EPHY_TYPE_PERMISSION_MANAGER,
-                                                ephy_permission_manager_iface_init))
+G_DEFINE_TYPE (EphyEmbedSingle, ephy_embed_single, G_TYPE_OBJECT)
 
 static void
 form_auth_data_free (EphyEmbedSingleFormAuthData *data)
@@ -233,54 +228,6 @@ ephy_embed_single_class_init (EphyEmbedSingleClass *klass)
   g_type_class_add_private (object_class, sizeof (EphyEmbedSinglePrivate));
 }
 
-static void
-impl_permission_manager_add (EphyPermissionManager *manager,
-                             const char *host,
-                             const char *type,
-                             EphyPermission permission)
-{
-}
-
-static void
-impl_permission_manager_remove (EphyPermissionManager *manager,
-                                const char *host,
-                                const char *type)
-{
-}
-
-static void
-impl_permission_manager_clear (EphyPermissionManager *manager)
-{
-}
-
-static EphyPermission
-impl_permission_manager_test (EphyPermissionManager *manager,
-                              const char *host,
-                              const char *type)
-{
-  g_return_val_if_fail (type != NULL && type[0] != '\0', EPHY_PERMISSION_DEFAULT);
-
-  return (EphyPermission)0;
-}
-
-static GList *
-impl_permission_manager_list (EphyPermissionManager *manager,
-                              const char *type)
-{
-  GList *list = NULL;
-  return list;
-}
-
-static void
-ephy_permission_manager_iface_init (EphyPermissionManagerIface *iface)
-{
-  iface->add = impl_permission_manager_add;
-  iface->remove = impl_permission_manager_remove;
-  iface->clear = impl_permission_manager_clear;
-  iface->test = impl_permission_manager_test;
-  iface->list = impl_permission_manager_list;
-}
-
 #ifndef HAVE_WEBKIT2
 static void
 cache_size_cb (GSettings *settings,
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index a2e6ce9..e653580 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -38,7 +38,6 @@
 #include "ephy-file-monitor.h"
 #include "ephy-history-service.h"
 #include "ephy-overview.h"
-#include "ephy-permission-manager.h"
 #include "ephy-prefs.h"
 #include "ephy-profile-utils.h"
 #include "ephy-settings.h"
@@ -283,24 +282,6 @@ static void
 ephy_web_view_set_popups_allowed (EphyWebView *view,
                                   gboolean allowed)
 {
-  const char *location;
-  EphyPermissionManager *manager;
-  EphyPermission permission;
-
-  manager = EPHY_PERMISSION_MANAGER
-            (ephy_embed_shell_get_embed_single (ephy_embed_shell_get_default ()));
-  g_return_if_fail (EPHY_IS_PERMISSION_MANAGER (manager));
-
-  permission = allowed ? EPHY_PERMISSION_ALLOWED
-               : EPHY_PERMISSION_DENIED;
-
-  location = ephy_web_view_get_address (view);
-  g_return_if_fail (location != NULL);
-
-  ephy_permission_manager_add_permission (manager, location,
-                                          EPHY_PERMISSION_TYPE_POPUP,
-                                          permission);
-
   if (allowed) {
     popups_manager_show_all (view);
   } else {
@@ -311,38 +292,14 @@ ephy_web_view_set_popups_allowed (EphyWebView *view,
 static gboolean
 ephy_web_view_get_popups_allowed (EphyWebView *view)
 {
-  EphyPermissionManager *permission_manager;
-  EphyPermission response;
   const char *location;
   gboolean allow;
 
-  permission_manager = EPHY_PERMISSION_MANAGER
-                       (ephy_embed_shell_get_embed_single (ephy_embed_shell_get_default ()));
-  g_return_val_if_fail (EPHY_IS_PERMISSION_MANAGER (permission_manager),
-                        FALSE);
-
   location = ephy_web_view_get_address (view);
   if (location == NULL) return FALSE;/* FALSE, TRUEâ same thing */
 
-  response = ephy_permission_manager_test_permission
-             (permission_manager, location, EPHY_PERMISSION_TYPE_POPUP);
-
-  switch (response) {
-    case EPHY_PERMISSION_ALLOWED:
-      allow = TRUE;
-      break;
-    case EPHY_PERMISSION_DENIED:
-      allow = FALSE;
-      break;
-    case EPHY_PERMISSION_DEFAULT:
-    default:
-      allow = g_settings_get_boolean (EPHY_SETTINGS_WEB,
-                                      EPHY_PREFS_WEB_ENABLE_POPUPS);
-      break;
-  }
-
-  LOG ("ephy_web_view_get_popups_allowed: view %p, allowed: %d", view, allow);
-
+  allow = g_settings_get_boolean (EPHY_SETTINGS_WEB,
+                                  EPHY_PREFS_WEB_ENABLE_POPUPS);
   return allow;
 }
 
diff --git a/src/epiphany.h.in b/src/epiphany.h.in
index 52550de..9c49f35 100644
--- a/src/epiphany.h.in
+++ b/src/epiphany.h.in
@@ -52,7 +52,6 @@
 #include <epiphany/ephy-node-db.h>
 #include <epiphany/ephy-node.h>
 #include <epiphany/ephy-notebook.h>
-#include <epiphany/ephy-permission-manager.h>
 #include <epiphany/ephy-session.h>
 #include <epiphany/ephy-shell.h>
 #include <epiphany/ephy-state.h>


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