| 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 <stdint.h> | |
| 9 | |
| 10 #include "base/macros.h" | 8 #include "base/macros.h" |
| 11 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 12 #include "content/public/browser/notification_database_data.h" | 10 #include "content/public/browser/notification_database_data.h" |
| 13 #include "content/public/browser/notification_event_dispatcher.h" | 11 #include "content/public/browser/notification_event_dispatcher.h" |
| 14 | 12 |
| 15 namespace content { | 13 namespace content { |
| 16 | 14 |
| 17 class NotificationEventDispatcherImpl : public NotificationEventDispatcher { | 15 class NotificationEventDispatcherImpl : public NotificationEventDispatcher { |
| 18 public: | 16 public: |
| 19 // Returns the instance of the NotificationEventDispatcherImpl. Must be called | 17 // Returns the instance of the NotificationEventDispatcherImpl. Must be called |
| 20 // on the UI thread. | 18 // on the UI thread. |
| 21 static NotificationEventDispatcherImpl* GetInstance(); | 19 static NotificationEventDispatcherImpl* GetInstance(); |
| 22 | 20 |
| 23 // NotificationEventDispatcher implementation. | 21 // NotificationEventDispatcher implementation. |
| 24 void DispatchNotificationClickEvent( | 22 void DispatchNotificationClickEvent( |
| 25 BrowserContext* browser_context, | 23 BrowserContext* browser_context, |
| 26 int64_t persistent_notification_id, | 24 const std::string& notification_id, |
| 27 const GURL& origin, | 25 const GURL& origin, |
| 28 int action_index, | 26 int action_index, |
| 29 const NotificationDispatchCompleteCallback& dispatch_complete_callback) | 27 const NotificationDispatchCompleteCallback& dispatch_complete_callback) |
| 30 override; | 28 override; |
| 31 void DispatchNotificationCloseEvent( | 29 void DispatchNotificationCloseEvent( |
| 32 BrowserContext* browser_context, | 30 BrowserContext* browser_context, |
| 33 int64_t persistent_notification_id, | 31 const std::string& notification_id, |
| 34 const GURL& origin, | 32 const GURL& origin, |
| 35 bool by_user, | 33 bool by_user, |
| 36 const NotificationDispatchCompleteCallback& dispatch_complete_callback) | 34 const NotificationDispatchCompleteCallback& dispatch_complete_callback) |
| 37 override; | 35 override; |
| 38 | 36 |
| 39 private: | 37 private: |
| 40 NotificationEventDispatcherImpl(); | 38 NotificationEventDispatcherImpl(); |
| 41 ~NotificationEventDispatcherImpl() override; | 39 ~NotificationEventDispatcherImpl() override; |
| 42 | 40 |
| 43 friend struct base::DefaultSingletonTraits<NotificationEventDispatcherImpl>; | 41 friend struct base::DefaultSingletonTraits<NotificationEventDispatcherImpl>; |
| 44 | 42 |
| 45 DISALLOW_COPY_AND_ASSIGN(NotificationEventDispatcherImpl); | 43 DISALLOW_COPY_AND_ASSIGN(NotificationEventDispatcherImpl); |
| 46 }; | 44 }; |
| 47 | 45 |
| 48 } // namespace content | 46 } // namespace content |
| 49 | 47 |
| 50 #endif // CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_EVENT_DISPATCHER_IMPL_H_ | 48 #endif // CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_EVENT_DISPATCHER_IMPL_H_ |
| OLD | NEW |