diff options
author | Michael Catanzaro <mcatanzaro@gnome.org> | 2016-12-30 18:21:42 -0600 |
---|---|---|
committer | Michael Catanzaro <mcatanzaro@gnome.org> | 2017-01-29 23:24:39 -0600 |
commit | 0eac0a9b793b4bacec12e585291e1ad79da0b542 (patch) | |
tree | 3e84bba106009aeacc68d599867af2175839c61a /embed/ephy-embed-shell.c | |
parent | 21fadda17d11764920374c61133feb1eb08203ee (diff) | |
download | epiphany-wip/form-auth-problem.tar.gz |
Set initial notification permissionswip/form-auth-problem
https://bugs.webkit.org/show_bug.cgi?id=163366
Diffstat (limited to 'embed/ephy-embed-shell.c')
-rw-r--r-- | embed/ephy-embed-shell.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c index 7e18019c3..80e1f3f1b 100644 --- a/embed/ephy-embed-shell.c +++ b/embed/ephy-embed-shell.c @@ -674,6 +674,24 @@ initialize_web_extensions (WebKitWebContext *web_context, } static void +initialize_notification_permissions (WebKitWebContext *web_context, + EphyEmbedShell *shell) +{ + EphyEmbedShellPrivate *priv = ephy_embed_shell_get_instance_private (shell); + GList *permitted_origins; + GList *denied_origins; + + permitted_origins = ephy_permissions_manager_get_permitted_origins (priv->permissions_manager, + EPHY_PERMISSION_TYPE_SHOW_NOTIFICATIONS); + denied_origins = ephy_permissions_manager_get_denied_origins (priv->permissions_manager, + EPHY_PERMISSION_TYPE_SHOW_NOTIFICATIONS); + webkit_web_context_initialize_notification_permissions (web_context, permitted_origins, denied_origins); + + g_list_free_full (permitted_origins, (GDestroyNotify)webkit_security_origin_unref); + g_list_free_full (denied_origins, (GDestroyNotify)webkit_security_origin_unref); +} + +static void web_extension_page_created (EphyWebExtensionProxy *extension, guint64 page_id, EphyEmbedShell *shell) @@ -905,6 +923,11 @@ ephy_embed_shell_startup (GApplication *application) G_CALLBACK (initialize_web_extensions), shell); + priv->permissions_manager = ephy_permissions_manager_new (); + g_signal_connect (priv->web_context, "initialize-notification-permissions", + G_CALLBACK (initialize_notification_permissions), + shell); + /* Favicon Database */ favicon_db_path = g_build_filename (EPHY_EMBED_SHELL_MODE_HAS_PRIVATE_PROFILE (priv->mode) ? ephy_dot_dir () : g_get_user_cache_dir (), @@ -1433,7 +1456,5 @@ ephy_embed_shell_get_permissions_manager (EphyEmbedShell *shell) { EphyEmbedShellPrivate *priv = ephy_embed_shell_get_instance_private (shell); - if (!priv->permissions_manager) - priv->permissions_manager = ephy_permissions_manager_new (); return priv->permissions_manager; } |