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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_NOTIFICATIONS_PERSISTENT_NOTIFICATION_DELEGATE_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_PERSISTENT_NOTIFICATION_DELEGATE_H_
11 #include "base/macros.h"
12 #include "chrome/browser/notifications/notification_delegate.h"
19 // Delegate responsible for listening to the click event on persistent
20 // notifications, to forward them to the PlatformNotificationService so that
21 // JavaScript events can be fired on the associated Service Worker.
22 class PersistentNotificationDelegate
: public NotificationDelegate
{
24 PersistentNotificationDelegate(content::BrowserContext
* browser_context
,
25 int64_t persistent_notification_id
,
27 int notification_settings_index
);
29 // Persistent id of this notification in the notification database. To be
30 // used when retrieving all information associated with it.
31 int64_t persistent_notification_id() const {
32 return persistent_notification_id_
;
35 // NotificationDelegate implementation.
36 void Display() override
;
37 void Close(bool by_user
) override
;
38 void Click() override
;
39 void ButtonClick(int button_index
) override
;
40 std::string
id() const override
;
43 ~PersistentNotificationDelegate() override
;
46 content::BrowserContext
* browser_context_
;
47 int64_t persistent_notification_id_
;
50 int notification_settings_index_
;
52 DISALLOW_COPY_AND_ASSIGN(PersistentNotificationDelegate
);
55 #endif // CHROME_BROWSER_NOTIFICATIONS_PERSISTENT_NOTIFICATION_DELEGATE_H_