OLD | NEW |
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 CONTENT_CHILD_NOTIFICATIONS_NOTIFICATION_MANAGER_H_ | 5 #ifndef CONTENT_CHILD_NOTIFICATIONS_NOTIFICATION_MANAGER_H_ |
6 #define CONTENT_CHILD_NOTIFICATIONS_NOTIFICATION_MANAGER_H_ | 6 #define CONTENT_CHILD_NOTIFICATIONS_NOTIFICATION_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 const blink::WebSerializedOrigin& origin); | 43 const blink::WebSerializedOrigin& origin); |
44 | 44 |
45 // Called by the NotificationDispatcher. | 45 // Called by the NotificationDispatcher. |
46 bool OnMessageReceived(const IPC::Message& message); | 46 bool OnMessageReceived(const IPC::Message& message); |
47 | 47 |
48 private: | 48 private: |
49 NotificationManager( | 49 NotificationManager( |
50 ThreadSafeSender* thread_safe_sender, | 50 ThreadSafeSender* thread_safe_sender, |
51 NotificationDispatcher* notification_dispatcher); | 51 NotificationDispatcher* notification_dispatcher); |
52 | 52 |
| 53 // IPC message handlers. |
| 54 void OnShow(int id); |
| 55 void OnError(int id); |
| 56 void OnClose(int id); |
| 57 void OnClick(int id); |
| 58 |
53 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 59 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
54 scoped_refptr<NotificationDispatcher> notification_dispatcher_; | 60 scoped_refptr<NotificationDispatcher> notification_dispatcher_; |
55 | 61 |
56 // Map to store the delegate associated with a notification request Id. | 62 // Map to store the delegate associated with a notification request Id. |
57 std::map<int, blink::WebNotificationDelegate*> active_notifications_; | 63 std::map<int, blink::WebNotificationDelegate*> active_notifications_; |
58 | 64 |
59 DISALLOW_COPY_AND_ASSIGN(NotificationManager); | 65 DISALLOW_COPY_AND_ASSIGN(NotificationManager); |
60 }; | 66 }; |
61 | 67 |
62 } // namespace content | 68 } // namespace content |
63 | 69 |
64 #endif // CONTENT_CHILD_NOTIFICATIONS_NOTIFICATION_MANAGER_H_ | 70 #endif // CONTENT_CHILD_NOTIFICATIONS_NOTIFICATION_MANAGER_H_ |
OLD | NEW |