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_BROWSER_NOTIFICATIONS_NOTIFICATION_EVENT_DISPATCHER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_EVENT_DISPATCHER_IMPL_H_ |
6 #define CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_EVENT_DISPATCHER_IMPL_H_ | 6 #define CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_EVENT_DISPATCHER_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
12 #include "content/public/browser/notification_database_data.h" | 12 #include "content/public/browser/notification_database_data.h" |
13 #include "content/public/browser/notification_event_dispatcher.h" | 13 #include "content/public/browser/notification_event_dispatcher.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 | 16 |
17 class NotificationEventDispatcherImpl : public NotificationEventDispatcher { | 17 class NotificationEventDispatcherImpl : public NotificationEventDispatcher { |
18 public: | 18 public: |
19 // Returns the instance of the NotificationEventDispatcherImpl. Must be called | 19 // Returns the instance of the NotificationEventDispatcherImpl. Must be called |
20 // on the UI thread. | 20 // on the UI thread. |
21 static NotificationEventDispatcherImpl* GetInstance(); | 21 static NotificationEventDispatcherImpl* GetInstance(); |
22 | 22 |
23 // NotificationEventDispatcher implementation. | 23 // NotificationEventDispatcher implementation. |
| 24 |
| 25 // TODO(miguelg) rename so it says Persistent. |
24 void DispatchNotificationClickEvent( | 26 void DispatchNotificationClickEvent( |
25 BrowserContext* browser_context, | 27 BrowserContext* browser_context, |
26 const std::string& notification_id, | 28 const std::string& notification_id, |
27 const GURL& origin, | 29 const GURL& origin, |
28 int action_index, | 30 int action_index, |
29 const base::NullableString16& reply, | 31 const base::NullableString16& reply, |
30 const NotificationDispatchCompleteCallback& dispatch_complete_callback) | 32 const NotificationDispatchCompleteCallback& dispatch_complete_callback) |
31 override; | 33 override; |
32 void DispatchNotificationCloseEvent( | 34 void DispatchNotificationCloseEvent( |
33 BrowserContext* browser_context, | 35 BrowserContext* browser_context, |
(...skipping 30 matching lines...) Expand all Loading... |
64 std::map<std::string, int> non_persistent_ids_; | 66 std::map<std::string, int> non_persistent_ids_; |
65 | 67 |
66 friend struct base::DefaultSingletonTraits<NotificationEventDispatcherImpl>; | 68 friend struct base::DefaultSingletonTraits<NotificationEventDispatcherImpl>; |
67 | 69 |
68 DISALLOW_COPY_AND_ASSIGN(NotificationEventDispatcherImpl); | 70 DISALLOW_COPY_AND_ASSIGN(NotificationEventDispatcherImpl); |
69 }; | 71 }; |
70 | 72 |
71 } // namespace content | 73 } // namespace content |
72 | 74 |
73 #endif // CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_EVENT_DISPATCHER_IMPL_H_ | 75 #endif // CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_EVENT_DISPATCHER_IMPL_H_ |
OLD | NEW |