OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CHROME_BROWSER_NOTIFICATIONS_PERSISTENT_NOTIFICATION_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_PERSISTENT_NOTIFICATION_HANDLER_H_ |
6 #define CHROME_BROWSER_NOTIFICATIONS_PERSISTENT_NOTIFICATION_HANDLER_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_PERSISTENT_NOTIFICATION_HANDLER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/browser/notifications/notification_handler.h" | 9 #include "chrome/browser/notifications/notification_handler.h" |
10 | 10 |
11 class NotificationDelegate; | |
12 | |
13 // NotificationHandler implementation for persistent, service worker backed, | 11 // NotificationHandler implementation for persistent, service worker backed, |
14 // notifications. | 12 // notifications. |
15 class PersistentNotificationHandler : public NotificationHandler { | 13 class PersistentNotificationHandler : public NotificationHandler { |
16 public: | 14 public: |
17 PersistentNotificationHandler(); | 15 PersistentNotificationHandler(); |
18 ~PersistentNotificationHandler() override; | 16 ~PersistentNotificationHandler() override; |
19 | 17 |
20 // NotificationHandler implementation. | 18 // NotificationHandler implementation. |
21 void OnClose(Profile* profile, | 19 void OnClose(Profile* profile, |
22 const std::string& origin, | 20 const std::string& origin, |
23 const std::string& notification_id, | 21 const std::string& notification_id, |
24 bool by_user) override; | 22 bool by_user) override; |
25 void OnClick(Profile* profile, | 23 void OnClick(Profile* profile, |
26 const std::string& origin, | 24 const std::string& origin, |
27 const std::string& notification_id, | 25 const std::string& notification_id, |
28 int action_index, | 26 int action_index, |
29 const base::NullableString16& reply) override; | 27 const base::NullableString16& reply) override; |
30 void OpenSettings(Profile* profile) override; | 28 void OpenSettings(Profile* profile) override; |
31 void RegisterNotification(const std::string& notification_id, | |
32 NotificationDelegate* delegate) override; | |
33 | 29 |
34 private: | 30 private: |
35 DISALLOW_COPY_AND_ASSIGN(PersistentNotificationHandler); | 31 DISALLOW_COPY_AND_ASSIGN(PersistentNotificationHandler); |
36 }; | 32 }; |
37 | 33 |
38 #endif // CHROME_BROWSER_NOTIFICATIONS_PERSISTENT_NOTIFICATION_HANDLER_H_ | 34 #endif // CHROME_BROWSER_NOTIFICATIONS_PERSISTENT_NOTIFICATION_HANDLER_H_ |
OLD | NEW |