Index: content/renderer/notification_provider.h |
diff --git a/content/renderer/notification_provider.h b/content/renderer/notification_provider.h |
index ab49b073cfbf5ab4a6bb57d19d31bf0942fd7065..6f8529f9afffa7eae54c94cc258931a02aac1627 100644 |
--- a/content/renderer/notification_provider.h |
+++ b/content/renderer/notification_provider.h |
@@ -5,11 +5,14 @@ |
#ifndef CONTENT_RENDERER_NOTIFICATION_PROVIDER_H_ |
#define CONTENT_RENDERER_NOTIFICATION_PROVIDER_H_ |
+#include "base/memory/scoped_vector.h" |
#include "content/public/renderer/render_frame_observer.h" |
#include "content/renderer/active_notification_tracker.h" |
#include "third_party/WebKit/public/web/WebNotification.h" |
#include "third_party/WebKit/public/web/WebNotificationPresenter.h" |
+class SkBitmap; |
+ |
namespace content { |
// NotificationProvider class is owned by the RenderFrame. Only to be used on |
@@ -24,13 +27,20 @@ class NotificationProvider : public RenderFrameObserver, |
// RenderFrameObserver implementation. |
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
- // blink::WebNotificationPresenter interface. |
+ // blink::WebNotificationPresenter implementation. |
virtual bool show(const blink::WebNotification& proxy); |
virtual void cancel(const blink::WebNotification& proxy); |
virtual void objectDestroyed(const blink::WebNotification& proxy); |
virtual blink::WebNotificationPresenter::Permission checkPermission( |
const blink::WebSecurityOrigin& origin); |
+ // Sends an IPC to the browser process to display |notification| |
+ // accompanied by the downloaded icon. |
+ void DisplayNotification(const blink::WebNotification& notification, |
+ const SkBitmap& icon); |
+ |
+ void RemovePendingNotification(const blink::WebNotification& notification); |
+ |
// IPC handlers. |
void OnDisplay(int id); |
void OnError(int id); |
@@ -38,6 +48,12 @@ class NotificationProvider : public RenderFrameObserver, |
void OnClick(int id); |
void OnNavigate(); |
+ class IconDownloader; |
+ |
+ // A vector tracking notifications which' icon is still being downloaded. |
Mike West
2014/09/18 19:48:43
Nit: Stray '. Perhaps "Vector containing notificat
Peter Beverloo
2014/09/19 14:15:48
It's not stray, it indicates ownership and doesn't
|
+ typedef ScopedVector<IconDownloader> PendingNotifications; |
+ PendingNotifications pending_notifications_; |
+ |
// A tracker object which manages the active notifications and the IDs |
// that are used to refer to them over IPC. |
ActiveNotificationTracker manager_; |