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

Unified Diff: content/browser/notifications/notification_message_filter.h

Issue 681783004: Implement the PageNotificationDelegate for the new Web Notification path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/DCHECK/if/ Created 6 years, 2 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: content/browser/notifications/notification_message_filter.h
diff --git a/content/browser/notification_message_filter.h b/content/browser/notifications/notification_message_filter.h
similarity index 54%
rename from content/browser/notification_message_filter.h
rename to content/browser/notifications/notification_message_filter.h
index 92f7b47b38d9e7ea16b42b704aa9e53c250c7285..9403ff112aa094330ba381d6b3c9429140839262 100644
--- a/content/browser/notification_message_filter.h
+++ b/content/browser/notifications/notification_message_filter.h
@@ -2,9 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_BROWSER_NOTIFICATION_MESSAGE_FILTER_H_
-#define CONTENT_BROWSER_NOTIFICATION_MESSAGE_FILTER_H_
+#ifndef CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_MESSAGE_FILTER_H_
+#define CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_MESSAGE_FILTER_H_
+#include <map>
+
+#include "base/callback_forward.h"
#include "content/public/browser/browser_message_filter.h"
#include "third_party/WebKit/public/platform/WebNotificationPermission.h"
@@ -12,6 +15,7 @@ class GURL;
namespace content {
+class BrowserContext;
class ResourceContext;
struct ShowDesktopNotificationHostMsgParams;
@@ -19,7 +23,12 @@ class NotificationMessageFilter : public BrowserMessageFilter {
public:
NotificationMessageFilter(
int process_id,
- ResourceContext* resource_context);
+ ResourceContext* resource_context,
+ BrowserContext* browser_context);
+
+ // Should be called by the notification's delegate when it has closed, so that
Avi (use Gerrit) 2014/10/29 20:25:52 I don't understand the word "should" here. Is it o
Peter Beverloo 2014/10/29 21:15:18 Ack. Changed to "to be called".
+ // the close closure associated with that notification can be removed.
+ void DidCloseNotification(int notification_id);
// BrowserMessageFilter implementation. Called on the UI thread.
bool OnMessageReceived(const IPC::Message& message) override;
@@ -31,15 +40,19 @@ class NotificationMessageFilter : public BrowserMessageFilter {
private:
void OnCheckNotificationPermission(
- const GURL& origin, blink::WebNotificationPermission* permission);
+ const GURL& origin, blink::WebNotificationPermission* permission);
void OnShowPlatformNotification(
- int notification_id, const ShowDesktopNotificationHostMsgParams& params);
+ int notification_id, const ShowDesktopNotificationHostMsgParams& params);
void OnClosePlatformNotification(int notification_id);
int process_id_;
ResourceContext* resource_context_;
+ BrowserContext* browser_context_;
+
+ // Map mapping notification Ids to their associated close closures.
Avi (use Gerrit) 2014/10/29 20:25:52 s/Ids/ids/
Peter Beverloo 2014/10/29 21:15:18 Done.
+ std::map<int, base::Closure> close_closures_;
};
} // namespace content
-#endif // CONTENT_BROWSER_NOTIFICATION_MESSAGE_FILTER_H_
+#endif // CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_MESSAGE_FILTER_H_

Powered by Google App Engine
This is Rietveld 408576698