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

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
« no previous file with comments | « chrome/browser/notifications/desktop_notification_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3d58c11bc0f5fce6dbc0d675a1beafbebae2d60c 100644
--- a/chrome/browser/notifications/desktop_notification_service.cc
+++ b/chrome/browser/notifications/desktop_notification_service.cc
@@ -313,6 +313,23 @@ void DesktopNotificationService::OnExtensionUninstalled(
#endif
}
+// Unlike other permission types, granting a notification for a given origin
+// will not take into account the |embedder_origin|, it will only be based
+// on the requesting iframe origin.
+// TODO(mukai) Consider why notifications behave differently than
+// other permissions. crbug.com/416894
+void DesktopNotificationService::UpdateContentSetting(
+ const GURL& requesting_origin,
+ const GURL& embedder_origin,
+ bool allowed) {
+ if (allowed) {
+ DesktopNotificationProfileUtil::GrantPermission(
+ profile_, requesting_origin);
+ } else {
+ DesktopNotificationProfileUtil::DenyPermission(profile_, requesting_origin);
+ }
+}
+
void DesktopNotificationService::OnNotificationPermissionRequested(
const NotificationPermissionCallback& callback, bool allowed) {
blink::WebNotificationPermission permission = allowed ?
« no previous file with comments | « chrome/browser/notifications/desktop_notification_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698