Index: content/browser/notifications/notification_message_filter.h |
diff --git a/content/browser/notifications/notification_message_filter.h b/content/browser/notifications/notification_message_filter.h |
index 9499a1334dd84e828086b74ce644305b1d6ad51a..8f400a681fb1601108dd52267d507e720e246a70 100644 |
--- a/content/browser/notifications/notification_message_filter.h |
+++ b/content/browser/notifications/notification_message_filter.h |
@@ -8,6 +8,8 @@ |
#include <map> |
#include "base/callback_forward.h" |
+#include "base/memory/weak_ptr.h" |
+#include "content/common/content_export.h" |
#include "content/public/browser/browser_message_filter.h" |
#include "third_party/WebKit/public/platform/modules/notifications/WebNotificationPermission.h" |
@@ -22,7 +24,7 @@ struct PlatformNotificationData; |
class PlatformNotificationService; |
class ResourceContext; |
-class NotificationMessageFilter : public BrowserMessageFilter { |
+class CONTENT_EXPORT NotificationMessageFilter : public BrowserMessageFilter { |
johnme
2015/04/02 17:21:07
Why does this need CONTENT_EXPORT?
Peter Beverloo
2015/04/07 17:46:11
For the NotificationBrowserTest. Removed per the n
|
public: |
NotificationMessageFilter( |
int process_id, |
@@ -43,6 +45,8 @@ class NotificationMessageFilter : public BrowserMessageFilter { |
~NotificationMessageFilter() override; |
private: |
+ friend class NotificationBrowserTest; |
johnme
2015/04/02 17:21:07
Please add this in https://codereview.chromium.org
Peter Beverloo
2015/04/07 17:46:11
Done.
|
+ |
void OnCheckNotificationPermission( |
const GURL& origin, blink::WebNotificationPermission* permission); |
void OnShowPlatformNotification( |
@@ -63,7 +67,30 @@ class NotificationMessageFilter : public BrowserMessageFilter { |
void OnClosePlatformNotification(int notification_id); |
void OnClosePersistentNotification( |
const GURL& origin, |
- const std::string& persistent_notification_id); |
+ int64_t persistent_notification_id); |
+ |
+ // Callback to be invoked by the notification context when the notification |
+ // data for the persistent notification may have been written, as indicated by |
+ // |success|. Will present the notification to the user when successful. |
+ void DidWritePersistentNotificationData( |
+ int request_id, |
+ int64_t service_worker_registration_id, |
+ const GURL& origin, |
+ const SkBitmap& icon, |
+ const PlatformNotificationData& notification_data, |
+ bool success, |
+ int64_t notification_id); |
johnme
2015/04/02 17:21:07
s/notification_id/persistent_notification_id/ !!
Peter Beverloo
2015/04/07 17:46:11
Done.
|
+ |
+ // Callback to be invoked when the data associated with a persistent |
+ // notification has been removed by the database, unless an error occurred, |
+ // which will be indicated by |success|. |
+ void DidDeletePersistentNotificationData(bool success); |
+ |
+ // Returns the permission status for |origin|. Must only be used on the IO |
+ // thread. If the PlatformNotificationService is unavailable, permission will |
+ // assumed to be denied. |
+ blink::WebNotificationPermission GetPermissionForOriginOnIO( |
+ const GURL& origin) const; |
// Verifies that Web Notification permission has been granted for |origin| in |
// cases where the renderer shouldn't send messages if it weren't the case. If |
@@ -80,6 +107,10 @@ class NotificationMessageFilter : public BrowserMessageFilter { |
// Map mapping notification ids to their associated close closures. |
std::map<int, base::Closure> close_closures_; |
+ |
+ base::WeakPtrFactory<NotificationMessageFilter> weak_factory_; |
johnme
2015/04/02 17:21:07
If you're handing out IO thread weak ptrs, you nee
Peter Beverloo
2015/04/07 17:46:11
Added the OnDestruct method. Renamed the member to
|
+ |
+ DISALLOW_COPY_AND_ASSIGN(NotificationMessageFilter); |
}; |
} // namespace content |