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

Unified Diff: content/child/notifications/notification_manager.h

Issue 644643005: Implement a RenderFrame-less path for Web Notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add OWNERS file 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/child/notifications/notification_manager.h
diff --git a/content/child/notifications/notification_manager.h b/content/child/notifications/notification_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..dc8147f0fa6567765aa200daa6af30c17ed4d7e4
--- /dev/null
+++ b/content/child/notifications/notification_manager.h
@@ -0,0 +1,64 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_CHILD_NOTIFICATIONS_NOTIFICATION_MANAGER_H_
+#define CONTENT_CHILD_NOTIFICATIONS_NOTIFICATION_MANAGER_H_
+
+#include <map>
+
+#include "base/memory/ref_counted.h"
+#include "content/child/notifications/notification_dispatcher.h"
+#include "content/child/worker_task_runner.h"
+#include "third_party/WebKit/public/platform/WebNotificationManager.h"
+
+class SkBitmap;
+
+namespace content {
+
+class ThreadSafeSender;
+
+class NotificationManager : public blink::WebNotificationManager,
+ public WorkerTaskRunner::Observer {
+ public:
+ ~NotificationManager() override;
+
+ // |thread_safe_sender| and |notification_dispatcher| are used if
+ // calling this leads to construction.
+ static NotificationManager* ThreadSpecificInstance(
+ ThreadSafeSender* thread_safe_sender,
+ NotificationDispatcher* notification_dispatcher);
+
+ // WorkerTaskRunner::Observer implementation.
+ void OnWorkerRunLoopStopped() override;
+
+ // blink::WebNotificationManager implementation.
+ virtual void show(const blink::WebSerializedOrigin& origin,
+ const blink::WebNotificationData& notification_data,
+ blink::WebNotificationDelegate* delegate);
+ virtual void close(blink::WebNotificationDelegate* delegate);
+ virtual void notifyDelegateDestroyed(
+ blink::WebNotificationDelegate* delegate);
+ virtual blink::WebNotificationPermission checkPermission(
+ const blink::WebSerializedOrigin& origin);
+
+ // Called by the NotificationDispatcher.
+ bool OnMessageReceived(const IPC::Message& message);
+
+ private:
+ NotificationManager(
+ ThreadSafeSender* thread_safe_sender,
+ NotificationDispatcher* notification_dispatcher);
+
+ scoped_refptr<ThreadSafeSender> thread_safe_sender_;
+ scoped_refptr<NotificationDispatcher> notification_dispatcher_;
+
+ // Map to store the delegate associated with a notification request Id.
+ std::map<int, blink::WebNotificationDelegate*> active_notifications_;
+
+ DISALLOW_COPY_AND_ASSIGN(NotificationManager);
+};
+
+} // namespace content
+
+#endif // CONTENT_CHILD_NOTIFICATIONS_NOTIFICATION_MANAGER_H_
« no previous file with comments | « content/child/notifications/notification_dispatcher.cc ('k') | content/child/notifications/notification_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698