OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef CHROME_BROWSER_NOTIFICATIONS_PERSISTENT_NOTIFICATION_DELEGATE_H_ | |
6 #define CHROME_BROWSER_NOTIFICATIONS_PERSISTENT_NOTIFICATION_DELEGATE_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/macros.h" | |
11 #include "chrome/browser/notifications/web_notification_delegate.h" | |
12 | |
13 class GURL; | |
14 | |
15 namespace content { | |
16 class BrowserContext; | |
17 } | |
18 | |
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 WebNotificationDelegate { | |
23 public: | |
24 PersistentNotificationDelegate(content::BrowserContext* browser_context, | |
25 const std::string& notification_id, | |
26 const GURL& origin, | |
27 int notification_settings_index); | |
28 | |
29 // NotificationDelegate implementation. | |
30 void Display() override; | |
31 void Close(bool by_user) override; | |
32 void Click() override; | |
33 void ButtonClick(int button_index) override; | |
34 void ButtonClickWithReply(int button_index, | |
35 const base::string16& reply) override; | |
36 | |
37 protected: | |
38 ~PersistentNotificationDelegate() override; | |
39 | |
40 private: | |
41 int notification_settings_index_; | |
42 | |
43 DISALLOW_COPY_AND_ASSIGN(PersistentNotificationDelegate); | |
44 }; | |
45 | |
46 #endif // CHROME_BROWSER_NOTIFICATIONS_PERSISTENT_NOTIFICATION_DELEGATE_H_ | |
OLD | NEW |