| 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 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // Called by the NotificationDispatcher. | 62 // Called by the NotificationDispatcher. |
| 63 bool OnMessageReceived(const IPC::Message& message); | 63 bool OnMessageReceived(const IPC::Message& message); |
| 64 | 64 |
| 65 private: | 65 private: |
| 66 NotificationManager( | 66 NotificationManager( |
| 67 ThreadSafeSender* thread_safe_sender, | 67 ThreadSafeSender* thread_safe_sender, |
| 68 base::SingleThreadTaskRunner* main_thread_task_runner, | 68 base::SingleThreadTaskRunner* main_thread_task_runner, |
| 69 NotificationDispatcher* notification_dispatcher); | 69 NotificationDispatcher* notification_dispatcher); |
| 70 | 70 |
| 71 // IPC message handlers. | 71 // IPC message handlers. |
| 72 void OnDidShowPersistent(int request_id); | |
| 73 void OnDidShow(int notification_id); | 72 void OnDidShow(int notification_id); |
| 74 void OnDidClose(int notification_id); | 73 void OnDidClose(int notification_id); |
| 75 void OnDidClick(int notification_id); | 74 void OnDidClick(int notification_id); |
| 76 | 75 |
| 77 // Asynchronously starts loading |image_url| on the main thread and returns a | 76 // Asynchronously starts loading |image_url| on the main thread and returns a |
| 78 // reference to the notification image loaded responsible for this. |callback| | 77 // reference to the notification image loaded responsible for this. |callback| |
| 79 // will be invoked on the calling thread when the load is complete. | 78 // will be invoked on the calling thread when the load is complete. |
| 80 scoped_refptr<NotificationImageLoader> CreateImageLoader( | 79 scoped_refptr<NotificationImageLoader> CreateImageLoader( |
| 81 const blink::WebURL& image_url, | 80 const blink::WebURL& image_url, |
| 82 const NotificationImageLoadedCallback& callback) const; | 81 const NotificationImageLoadedCallback& callback) const; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 std::map<int, blink::WebNotificationDelegate*> active_notifications_; | 123 std::map<int, blink::WebNotificationDelegate*> active_notifications_; |
| 125 | 124 |
| 126 base::WeakPtrFactory<NotificationManager> weak_factory_; | 125 base::WeakPtrFactory<NotificationManager> weak_factory_; |
| 127 | 126 |
| 128 DISALLOW_COPY_AND_ASSIGN(NotificationManager); | 127 DISALLOW_COPY_AND_ASSIGN(NotificationManager); |
| 129 }; | 128 }; |
| 130 | 129 |
| 131 } // namespace content | 130 } // namespace content |
| 132 | 131 |
| 133 #endif // CONTENT_CHILD_NOTIFICATIONS_NOTIFICATION_MANAGER_H_ | 132 #endif // CONTENT_CHILD_NOTIFICATIONS_NOTIFICATION_MANAGER_H_ |
| OLD | NEW |