[epiphany/gnome-3-18] Always allow notification requests when under application mode



commit fd73b652c1ed85728a10c3f12cd3d245e88b04fe
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 838768f..a1f1b6d 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -1431,6 +1431,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]