[epiphany] Always allow notification requests when under application mode



commit cde2e8858da0fcb3b7c706d47a341b9eefb2025c
Author: Gustavo Noronha Silva <gns gnome org>
Date:   Tue Dec 8 14:26:13 2015 +0100

    Always allow notification requests when under application mode
    
    It is assumed that if a person creates a web app they are also willing to
    get notifications from that app as they would from any other regular app.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=759176

 embed/ephy-web-view.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 42f13a4..2af0cae 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -1386,6 +1386,13 @@ permission_request_cb (WebKitWebView           *web_view,
       !WEBKIT_IS_NOTIFICATION_PERMISSION_REQUEST (decision))
     return FALSE;
 
+  /* Application mode implies being OK with notifications. */
+  if (WEBKIT_IS_NOTIFICATION_PERMISSION_REQUEST (decision) &&
+      ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) == EPHY_EMBED_SHELL_MODE_APPLICATION) {
+    webkit_permission_request_allow (decision);
+    return TRUE;
+  }
+
   info_bar = gtk_info_bar_new_with_buttons (_("Deny"), GTK_RESPONSE_NO,
                                             _("Allow"), GTK_RESPONSE_YES,
                                             NULL);


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