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

Side by Side Diff: chrome/browser/notifications/platform_notification_service_impl.h

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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ 6 #define CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 void DisplayNotification( 77 void DisplayNotification(
78 content::BrowserContext* browser_context, 78 content::BrowserContext* browser_context,
79 const GURL& origin, 79 const GURL& origin,
80 const content::PlatformNotificationData& notification_data, 80 const content::PlatformNotificationData& notification_data,
81 const content::NotificationResources& notification_resources, 81 const content::NotificationResources& notification_resources,
82 std::unique_ptr<content::DesktopNotificationDelegate> delegate, 82 std::unique_ptr<content::DesktopNotificationDelegate> delegate,
83 base::Closure* cancel_callback) override; 83 base::Closure* cancel_callback) override;
84 void DisplayPersistentNotification( 84 void DisplayPersistentNotification(
85 content::BrowserContext* browser_context, 85 content::BrowserContext* browser_context,
86 int64_t persistent_notification_id, 86 int64_t persistent_notification_id,
87 const GURL& service_worker_scope,
87 const GURL& origin, 88 const GURL& origin,
88 const content::PlatformNotificationData& notification_data, 89 const content::PlatformNotificationData& notification_data,
89 const content::NotificationResources& notification_resources) override; 90 const content::NotificationResources& notification_resources) override;
90 void ClosePersistentNotification( 91 void ClosePersistentNotification(
91 content::BrowserContext* browser_context, 92 content::BrowserContext* browser_context,
92 int64_t persistent_notification_id) override; 93 int64_t persistent_notification_id) override;
93 bool GetDisplayedPersistentNotifications( 94 bool GetDisplayedPersistentNotifications(
94 content::BrowserContext* browser_context, 95 content::BrowserContext* browser_context,
95 std::set<std::string>* displayed_notifications) override; 96 std::set<std::string>* displayed_notifications) override;
96 97
(...skipping 15 matching lines...) Expand all
112 void OnClickEventDispatchComplete( 113 void OnClickEventDispatchComplete(
113 content::PersistentNotificationStatus status); 114 content::PersistentNotificationStatus status);
114 void OnCloseEventDispatchComplete( 115 void OnCloseEventDispatchComplete(
115 content::PersistentNotificationStatus status); 116 content::PersistentNotificationStatus status);
116 117
117 // Creates a new Web Notification-based Notification object. 118 // Creates a new Web Notification-based Notification object.
118 // TODO(peter): |delegate| can be a scoped_refptr, but properly passing this 119 // TODO(peter): |delegate| can be a scoped_refptr, but properly passing this
119 // through requires changing a whole lot of Notification constructor calls. 120 // through requires changing a whole lot of Notification constructor calls.
120 Notification CreateNotificationFromData( 121 Notification CreateNotificationFromData(
121 Profile* profile, 122 Profile* profile,
123 const GURL& service_worker_scope,
122 const GURL& origin, 124 const GURL& origin,
123 const content::PlatformNotificationData& notification_data, 125 const content::PlatformNotificationData& notification_data,
124 const content::NotificationResources& notification_resources, 126 const content::NotificationResources& notification_resources,
125 NotificationDelegate* delegate) const; 127 NotificationDelegate* delegate) const;
126 128
127 // Returns a display name for an origin, to be used in the context message 129 // Returns a display name for an origin, to be used in the context message
128 base::string16 DisplayNameForContextMessage(Profile* profile, 130 base::string16 DisplayNameForContextMessage(Profile* profile,
129 const GURL& origin) const; 131 const GURL& origin) const;
130 132
131 // Returns the notification display service to use. 133 // Returns the notification display service to use.
(...skipping 23 matching lines...) Expand all
155 // programmatically to avoid dispatching close events for them. 157 // programmatically to avoid dispatching close events for them.
156 std::unordered_set<int64_t> closed_notifications_; 158 std::unordered_set<int64_t> closed_notifications_;
157 159
158 // Only set and used for tests, owned by the caller in that case. 160 // Only set and used for tests, owned by the caller in that case.
159 NotificationDisplayService* test_display_service_; 161 NotificationDisplayService* test_display_service_;
160 162
161 DISALLOW_COPY_AND_ASSIGN(PlatformNotificationServiceImpl); 163 DISALLOW_COPY_AND_ASSIGN(PlatformNotificationServiceImpl);
162 }; 164 };
163 165
164 #endif // CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ 166 #endif // CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698