OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
Peter Beverloo
2016/07/05 14:25:34
nit: non_persistent_notification_handler.h
Miguel Garcia
2016/07/05 17:12:52
Done.
| |
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_NONPERSISTENT_NOTIFICATION_HANDLER_H_ | |
6 #define CHROME_BROWSER_NOTIFICATIONS_NONPERSISTENT_NOTIFICATION_HANDLER_H_ | |
7 | |
8 #include <unordered_map> | |
9 | |
10 #include "base/macros.h" | |
11 #include "base/memory/ref_counted.h" | |
12 #include "chrome/browser/notifications/notification_common.h" | |
13 #include "chrome/browser/notifications/notification_handler.h" | |
14 | |
15 class NotificationDelegate; | |
16 | |
17 // NotificationHandler implementation for non persistent | |
18 // notifications. | |
Peter Beverloo
2016/07/05 14:25:34
nit: No need to wrap.
Miguel Garcia
2016/07/05 17:12:52
Done.
| |
19 class NonPersistentNotificationHandler : public NotificationHandler { | |
20 public: | |
21 NonPersistentNotificationHandler(); | |
22 ~NonPersistentNotificationHandler() override; | |
23 | |
24 void Close(Profile* profile, | |
25 const std::string& origin, | |
26 const std::string& notification_id, | |
27 bool by_user) override; | |
28 | |
29 void Click(Profile* profile, | |
30 const std::string& origin, | |
31 const std::string& notification_id, | |
32 int action_index) override; | |
33 | |
34 void Settings(Profile* profile) override; | |
35 | |
36 void RegisterNotification(const std::string& notification_id, | |
37 NotificationDelegate* delegate) override; | |
38 | |
39 NotificationCommon::Type NotificationType() override; | |
40 | |
41 private: | |
42 // map of delegate objects keyed by notification id. | |
43 std::unordered_map<std::string, scoped_refptr<NotificationDelegate>> | |
44 notifications_; | |
45 | |
46 DISALLOW_COPY_AND_ASSIGN(NonPersistentNotificationHandler); | |
47 }; | |
48 | |
49 #endif // CHROME_BROWSER_NOTIFICATIONS_NONPERSISTENT_NOTIFICATION_HANDLER_H_ | |
OLD | NEW |