Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(433)

Unified Diff: chrome/browser/notifications/desktop_notification_service.cc

Issue 593153002: Restore the iframe behavior of notification permissions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/notifications/desktop_notification_service.cc
diff --git a/chrome/browser/notifications/desktop_notification_service.cc b/chrome/browser/notifications/desktop_notification_service.cc
index eb6d72f6b7a30377eba03195accebb1370a8bd0e..67f5a7d33c46ab9e500fda8d0543397838fc35db 100644
--- a/chrome/browser/notifications/desktop_notification_service.cc
+++ b/chrome/browser/notifications/desktop_notification_service.cc
@@ -313,6 +313,21 @@ void DesktopNotificationService::OnExtensionUninstalled(
#endif
}
+// Unlike other permission types, granting a notification for a given origin
+// will grant it even if it is embedded as an iframe in other domains.
Peter Beverloo 2014/09/23 15:58:47 This is phrased a bit ambiguously, what about the
Bernhard Bauer 2014/09/23 16:13:02 I would point out in the comment that the embeddin
Miguel Garcia 2014/09/23 16:53:38 Acknowledged.
Miguel Garcia 2014/09/23 16:53:39 Done.
+void DesktopNotificationService::UpdateContentSetting(
+ const GURL& requesting_origin,
+ const GURL& embedder_origin,
+ bool allowed) {
+ if (allowed)
Bernhard Bauer 2014/09/23 16:13:02 Braces can only be omitted for single-line bodies.
Miguel Garcia 2014/09/23 16:53:39 Done.
+ DesktopNotificationProfileUtil::GrantPermission(
+ profile_, requesting_origin);
+ else
+ DesktopNotificationProfileUtil::DenyPermission(profile_, requesting_origin);
+}
+
Peter Beverloo 2014/09/23 15:58:47 nit: only a single blank line.
Miguel Garcia 2014/09/23 16:53:39 Done.
+
+
void DesktopNotificationService::OnNotificationPermissionRequested(
const NotificationPermissionCallback& callback, bool allowed) {
blink::WebNotificationPermission permission = allowed ?

Powered by Google App Engine
This is Rietveld 408576698