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