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

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

Issue 2151993002: [WebAPKs] Plumb service worker scope to notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into notification_scope Created 4 years, 5 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/platform_notification_service_impl.cc
diff --git a/chrome/browser/notifications/platform_notification_service_impl.cc b/chrome/browser/notifications/platform_notification_service_impl.cc
index 6e52f15d3fe004fd3b5686a9912fdd98a6779c5d..4f38094102dea69722859ce6319b3df1ff2117e8 100644
--- a/chrome/browser/notifications/platform_notification_service_impl.cc
+++ b/chrome/browser/notifications/platform_notification_service_impl.cc
@@ -289,7 +289,8 @@ void PlatformNotificationServiceImpl::DisplayNotification(
NotificationObjectProxy* proxy =
new NotificationObjectProxy(browser_context, std::move(delegate));
Notification notification = CreateNotificationFromData(
- profile, origin, notification_data, notification_resources, proxy);
+ profile, GURL() /* service_worker_scope */, origin, notification_data,
+ notification_resources, proxy);
GetNotificationDisplayService(profile)->Display(
NotificationCommon::NON_PERSISTENT, notification.delegate_id(),
@@ -313,6 +314,7 @@ void PlatformNotificationServiceImpl::DisplayNotification(
void PlatformNotificationServiceImpl::DisplayPersistentNotification(
BrowserContext* browser_context,
int64_t persistent_notification_id,
+ const GURL& service_worker_scope,
const GURL& origin,
const content::PlatformNotificationData& notification_data,
const content::NotificationResources& notification_resources) {
@@ -329,7 +331,8 @@ void PlatformNotificationServiceImpl::DisplayPersistentNotification(
settings_button_index);
Notification notification = CreateNotificationFromData(
- profile, origin, notification_data, notification_resources, delegate);
+ profile, service_worker_scope, origin, notification_data,
+ notification_resources, delegate);
// TODO(peter): Remove this mapping when we have reliable id generation for
// the message_center::Notification objects.
@@ -418,6 +421,7 @@ void PlatformNotificationServiceImpl::OnCloseEventDispatchComplete(
Notification PlatformNotificationServiceImpl::CreateNotificationFromData(
Profile* profile,
+ const GURL& service_worker_scope,
const GURL& origin,
const content::PlatformNotificationData& notification_data,
const content::NotificationResources& notification_resources,
@@ -435,6 +439,7 @@ Notification PlatformNotificationServiceImpl::CreateNotificationFromData(
origin, notification_data.tag, message_center::RichNotificationData(),
delegate);
+ notification.set_service_worker_scope(service_worker_scope);
notification.set_context_message(
DisplayNameForContextMessage(profile, origin));
notification.set_vibration_pattern(notification_data.vibration_pattern);

Powered by Google App Engine
This is Rietveld 408576698